diff --git a/dsh/app.py b/dsh/app.py index 0f545a7..8bbb454 100644 --- a/dsh/app.py +++ b/dsh/app.py @@ -34,7 +34,7 @@ BASE_DIR = Path(__file__).resolve().parent USER_NAME = os.getenv("DSH_USER", "user") DEFAULT_SLOT = os.getenv("DSH_SLOT", "Welcome to DeepSeek Harness") LLM_BASE = os.getenv("DSH_LLM_BASE", "http://192.168.20.13:20129/v1") -LLM_MODEL = os.getenv("DSH_LLM_MODEL", "auto/best-chat") +LLM_MODEL = os.getenv("DSH_LLM_MODEL", "auto/best-fast") LLM_KEY = os.getenv("DSH_LLM_KEY", "") SYSTEM_PROMPT = os.getenv( "DSH_SYSTEM_PROMPT", @@ -248,8 +248,11 @@ async def chat(message: Annotated[str, Form()], else: base = LLM_BASE key = LLM_KEY + active_model = session.get("model") or LLM_MODEL + if active_model not in MODEL_CHOICES: + active_model = LLM_MODEL payload = { - "model": session.get("model") or LLM_MODEL, + "model": active_model, "messages": [{"role": "system", "content": SYSTEM_PROMPT}] + hist, "stream": True, "temperature": 0.7, @@ -283,6 +286,8 @@ async def chat(message: Annotated[str, Form()], return if full: hist.append({"role": "assistant", "content": "".join(full)}) + else: + yield f"data: {json.dumps({'e': 'Model returned no response — try auto/best-chat or auto/best-fast.'})}\n\n" save_session(sid, hist, session.get("model")) # always persist user turn + chosen model return StreamingResponse( @@ -322,7 +327,7 @@ async def generate_image(prompt: Annotated[str, Form()]) -> dict: -MODEL_CHOICES = ["auto/best-chat", "auto/best-fast", "auto/best-reasoning", +MODEL_CHOICES = ["auto/best-chat", "auto/best-fast", "auto/best-coding", "auto/best-vision"] diff --git a/dsh/docker-compose.yml b/dsh/docker-compose.yml index 17a2e7f..a145195 100644 --- a/dsh/docker-compose.yml +++ b/dsh/docker-compose.yml @@ -22,7 +22,7 @@ x-dsh-common: &common - /tmp environment: &env-base DSH_LLM_BASE: http://192.168.20.13:20129/v1 - DSH_LLM_MODEL: auto/best-chat + DSH_LLM_MODEL: auto/best-fast DSH_HISTORY_DIR: /data DSH_VISION_KEY: ${DSH_VISION_KEY:-} DSH_VISION_MODEL: openai/gpt-5