forked from phoenix/litellm-mirror
build: build fixes
This commit is contained in:
parent
a8d3d51d21
commit
8c91156842
4 changed files with 18 additions and 8 deletions
|
@ -38,6 +38,11 @@ RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt
|
||||||
# install semantic-cache [Experimental]- we need this here and not in requirements.txt because redisvl pins to pydantic 1.0
|
# install semantic-cache [Experimental]- we need this here and not in requirements.txt because redisvl pins to pydantic 1.0
|
||||||
RUN pip install redisvl==0.0.7 --no-deps
|
RUN pip install redisvl==0.0.7 --no-deps
|
||||||
|
|
||||||
|
# ensure pyjwt is used, not jwt
|
||||||
|
RUN pip uninstall jwt -y
|
||||||
|
RUN pip uninstall PyJWT -y
|
||||||
|
RUN pip install PyJWT --no-cache-dir
|
||||||
|
|
||||||
# Build Admin UI
|
# Build Admin UI
|
||||||
RUN chmod +x build_admin_ui.sh && ./build_admin_ui.sh
|
RUN chmod +x build_admin_ui.sh && ./build_admin_ui.sh
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ JWT token must have 'litellm_proxy_admin' in scope.
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
import jwt
|
import jwt
|
||||||
import json
|
|
||||||
from jwt.algorithms import RSAAlgorithm
|
from jwt.algorithms import RSAAlgorithm
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
from litellm.proxy._types import LiteLLMProxyRoles
|
from litellm.proxy._types import LiteLLMProxyRoles
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
|
@ -1870,7 +1870,9 @@ async def update_spend(
|
||||||
if len(prisma_client.user_list_transactons.keys()) > 0:
|
if len(prisma_client.user_list_transactons.keys()) > 0:
|
||||||
for i in range(n_retry_times + 1):
|
for i in range(n_retry_times + 1):
|
||||||
try:
|
try:
|
||||||
async with prisma_client.db.tx(timeout=6000) as transaction:
|
async with prisma_client.db.tx(
|
||||||
|
timeout=timedelta(seconds=60)
|
||||||
|
) as transaction:
|
||||||
async with transaction.batch_() as batcher:
|
async with transaction.batch_() as batcher:
|
||||||
for (
|
for (
|
||||||
user_id,
|
user_id,
|
||||||
|
@ -1895,7 +1897,9 @@ async def update_spend(
|
||||||
if len(prisma_client.end_user_list_transactons.keys()) > 0:
|
if len(prisma_client.end_user_list_transactons.keys()) > 0:
|
||||||
for i in range(n_retry_times + 1):
|
for i in range(n_retry_times + 1):
|
||||||
try:
|
try:
|
||||||
async with prisma_client.db.tx(timeout=6000) as transaction:
|
async with prisma_client.db.tx(
|
||||||
|
timeout=timedelta(seconds=60)
|
||||||
|
) as transaction:
|
||||||
async with transaction.batch_() as batcher:
|
async with transaction.batch_() as batcher:
|
||||||
for (
|
for (
|
||||||
end_user_id,
|
end_user_id,
|
||||||
|
@ -1926,7 +1930,9 @@ async def update_spend(
|
||||||
if len(prisma_client.key_list_transactons.keys()) > 0:
|
if len(prisma_client.key_list_transactons.keys()) > 0:
|
||||||
for i in range(n_retry_times + 1):
|
for i in range(n_retry_times + 1):
|
||||||
try:
|
try:
|
||||||
async with prisma_client.db.tx(timeout=6000) as transaction:
|
async with prisma_client.db.tx(
|
||||||
|
timeout=timedelta(seconds=60)
|
||||||
|
) as transaction:
|
||||||
async with transaction.batch_() as batcher:
|
async with transaction.batch_() as batcher:
|
||||||
for (
|
for (
|
||||||
token,
|
token,
|
||||||
|
@ -1951,7 +1957,9 @@ async def update_spend(
|
||||||
if len(prisma_client.team_list_transactons.keys()) > 0:
|
if len(prisma_client.team_list_transactons.keys()) > 0:
|
||||||
for i in range(n_retry_times + 1):
|
for i in range(n_retry_times + 1):
|
||||||
try:
|
try:
|
||||||
async with prisma_client.db.tx(timeout=6000) as transaction:
|
async with prisma_client.db.tx(
|
||||||
|
timeout=timedelta(seconds=60)
|
||||||
|
) as transaction:
|
||||||
async with transaction.batch_() as batcher:
|
async with transaction.batch_() as batcher:
|
||||||
for (
|
for (
|
||||||
team_id,
|
team_id,
|
||||||
|
@ -1972,8 +1980,6 @@ async def update_spend(
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
### UPDATE SPEND LOGS TABLE ###
|
|
||||||
|
|
||||||
|
|
||||||
async def monitor_spend_list(prisma_client: PrismaClient):
|
async def monitor_spend_list(prisma_client: PrismaClient):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -24,7 +24,6 @@ apscheduler==3.10.4 # for resetting budget in background
|
||||||
fastapi-sso==0.10.0 # admin UI, SSO
|
fastapi-sso==0.10.0 # admin UI, SSO
|
||||||
PyJWT==2.8.0 # admin UI, jwts
|
PyJWT==2.8.0 # admin UI, jwts
|
||||||
python-multipart==0.0.6 # admin UI
|
python-multipart==0.0.6 # admin UI
|
||||||
jwt==1.3.1 # for jwt auth
|
|
||||||
### LITELLM PACKAGE DEPENDENCIES
|
### LITELLM PACKAGE DEPENDENCIES
|
||||||
python-dotenv>=0.2.0 # for env
|
python-dotenv>=0.2.0 # for env
|
||||||
tiktoken>=0.4.0 # for calculating usage
|
tiktoken>=0.4.0 # for calculating usage
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue