dsh: clear no-response feedback; remove broken best-reasoning; default to best-fast (OmniRoute streaming flaky)
This commit is contained in:
11
dsh/app.py
11
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"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user