fix+feat: offene Punkte abgeschlossen
Kontext in Connect-Snippet: - ConnectPanel: max_tokens nutzt jetzt den echten konfigurierten Kontext des Modells (m.meta.ctx) statt hartkodiertem 32768 -> Zed sieht 128k Phase D - 'Immer aktiv halten' Toggle: - models.py: UpdateReq bekommt optionales ttl-Feld - update_model: setzt TTL wenn angegeben (ctx und ttl unabhaengig) - ModelsPanel: Checkbox 'Immer aktiv halten' im Konfig-Modal (TTL=99999 = nie entladen, TTL=300 = Standard 5min) MoE tps-Schaetzung: - hw_math.py: extract_active_params_b() erkennt A3B-Suffix - estimate_speed(): moe_active_ratio-Parameter, sqrt-Boost fuer MoE - evaluate_fit(): name-Parameter (optional) fuer automatische MoE-Erkennung - cookbook.py: alle evaluate_fit-Aufrufe mit name= versehen Cleanup: - static/js/panels/*.js + static/js/main.js geloescht (Dead Code) - wird-Datei (versehentlich committet) geloescht - CLAUDE.md: KISS-Statement auf Vite+Svelte-Stand aktualisiert Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+15
-11
@@ -58,7 +58,8 @@ class ChatReq(BaseModel):
|
||||
|
||||
class UpdateReq(BaseModel):
|
||||
alias: str
|
||||
ctx: int
|
||||
ctx: int | None = None
|
||||
ttl: int | None = None
|
||||
|
||||
|
||||
class DeleteReq(BaseModel):
|
||||
@@ -251,17 +252,20 @@ def update_model(req: UpdateReq):
|
||||
cfg = read_config()
|
||||
if req.alias not in cfg.get("models", {}):
|
||||
raise HTTPException(404, "Modell nicht gefunden")
|
||||
|
||||
|
||||
spec = cfg["models"][req.alias]
|
||||
cmd = str(spec.get("cmd", ""))
|
||||
|
||||
# Replace or add context size
|
||||
if re.search(r'-(?:c|-ctx-size)\s+\d+', cmd):
|
||||
cmd = re.sub(r'-(?:c|-ctx-size)\s+\d+', f'-c {req.ctx}', cmd)
|
||||
else:
|
||||
cmd = cmd.strip() + f" -c {req.ctx}\n"
|
||||
|
||||
cfg["models"][req.alias]["cmd"] = LiteralScalarString(cmd)
|
||||
|
||||
if req.ctx is not None:
|
||||
cmd = str(spec.get("cmd", ""))
|
||||
if re.search(r'-(?:c|-ctx-size)\s+\d+', cmd):
|
||||
cmd = re.sub(r'-(?:c|-ctx-size)\s+\d+', f'-c {req.ctx}', cmd)
|
||||
else:
|
||||
cmd = cmd.strip() + f" -c {req.ctx}\n"
|
||||
cfg["models"][req.alias]["cmd"] = LiteralScalarString(cmd)
|
||||
|
||||
if req.ttl is not None:
|
||||
cfg["models"][req.alias]["ttl"] = req.ttl
|
||||
|
||||
write_config(cfg)
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user