dsh: clear no-response feedback; remove broken best-reasoning; default to best-fast (OmniRoute streaming flaky)

This commit is contained in:
2026-08-26 21:34:58 +10:00
parent cc35cbb6a3
commit 08e43b700a
2 changed files with 9 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ BASE_DIR = Path(__file__).resolve().parent
USER_NAME = os.getenv("DSH_USER", "user") USER_NAME = os.getenv("DSH_USER", "user")
DEFAULT_SLOT = os.getenv("DSH_SLOT", "Welcome to DeepSeek Harness") 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_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", "") LLM_KEY = os.getenv("DSH_LLM_KEY", "")
SYSTEM_PROMPT = os.getenv( SYSTEM_PROMPT = os.getenv(
"DSH_SYSTEM_PROMPT", "DSH_SYSTEM_PROMPT",
@@ -248,8 +248,11 @@ async def chat(message: Annotated[str, Form()],
else: else:
base = LLM_BASE base = LLM_BASE
key = LLM_KEY key = LLM_KEY
active_model = session.get("model") or LLM_MODEL
if active_model not in MODEL_CHOICES:
active_model = LLM_MODEL
payload = { payload = {
"model": session.get("model") or LLM_MODEL, "model": active_model,
"messages": [{"role": "system", "content": SYSTEM_PROMPT}] + hist, "messages": [{"role": "system", "content": SYSTEM_PROMPT}] + hist,
"stream": True, "stream": True,
"temperature": 0.7, "temperature": 0.7,
@@ -283,6 +286,8 @@ async def chat(message: Annotated[str, Form()],
return return
if full: if full:
hist.append({"role": "assistant", "content": "".join(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 save_session(sid, hist, session.get("model")) # always persist user turn + chosen model
return StreamingResponse( 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"] "auto/best-coding", "auto/best-vision"]

View File

@@ -22,7 +22,7 @@ x-dsh-common: &common
- /tmp - /tmp
environment: &env-base environment: &env-base
DSH_LLM_BASE: http://192.168.20.13:20129/v1 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_HISTORY_DIR: /data
DSH_VISION_KEY: ${DSH_VISION_KEY:-} DSH_VISION_KEY: ${DSH_VISION_KEY:-}
DSH_VISION_MODEL: openai/gpt-5 DSH_VISION_MODEL: openai/gpt-5