Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Upload agent/core/model_switcher.py
Browse files- agent/core/model_switcher.py +5 -10
agent/core/model_switcher.py
CHANGED
|
@@ -29,8 +29,10 @@ from agent.core.local_models import (
|
|
| 29 |
from agent.core.model_ids import (
|
| 30 |
CLAUDE_OPUS_48_MODEL_ID,
|
| 31 |
DEEPSEEK_V4_PRO_MODEL_ID,
|
|
|
|
| 32 |
GLM_52_MODEL_ID,
|
| 33 |
GPT_55_MODEL_ID,
|
|
|
|
| 34 |
KIMI_K27_CODE_MODEL_ID,
|
| 35 |
MINIMAX_M3_MODEL_ID,
|
| 36 |
strip_huggingface_model_prefix,
|
|
@@ -42,6 +44,8 @@ from agent.core.model_ids import (
|
|
| 42 |
# ":cheapest", ":preferred", or ":<provider>" to override the default routing
|
| 43 |
# policy (auto = fastest with failover).
|
| 44 |
SUGGESTED_MODELS = [
|
|
|
|
|
|
|
| 45 |
{"id": CLAUDE_OPUS_48_MODEL_ID, "label": "Claude Opus 4.8"},
|
| 46 |
{"id": GPT_55_MODEL_ID, "label": "GPT-5.5"},
|
| 47 |
{"id": MINIMAX_M3_MODEL_ID, "label": "MiniMax M3"},
|
|
@@ -168,15 +172,6 @@ def print_model_listing(config, console) -> None:
|
|
| 168 |
)
|
| 169 |
|
| 170 |
|
| 171 |
-
def print_invalid_id(arg: str, console) -> None:
|
| 172 |
-
console.print(f"[bold red]Invalid model id format:[/bold red] {arg}")
|
| 173 |
-
console.print(
|
| 174 |
-
"[dim]Expected:\n"
|
| 175 |
-
" • <org>/<model>[:tag] (HF router — paste from huggingface.co)\n"
|
| 176 |
-
" • ollama/<model> | vllm/<model> | lm_studio/<model> | llamacpp/<model>[/dim]"
|
| 177 |
-
)
|
| 178 |
-
|
| 179 |
-
|
| 180 |
async def _probe_local_model(model_id: str) -> None:
|
| 181 |
params = _resolve_llm_params(model_id)
|
| 182 |
await asyncio.wait_for(
|
|
@@ -287,4 +282,4 @@ def _commit_switch(model_id, config, session, effective, cache: bool) -> None:
|
|
| 287 |
else:
|
| 288 |
session.model_effective_effort.pop(model_id, None)
|
| 289 |
else:
|
| 290 |
-
config.model_name = model_id
|
|
|
|
| 29 |
from agent.core.model_ids import (
|
| 30 |
CLAUDE_OPUS_48_MODEL_ID,
|
| 31 |
DEEPSEEK_V4_PRO_MODEL_ID,
|
| 32 |
+
GEMMA_4_31B_MODEL_ID,
|
| 33 |
GLM_52_MODEL_ID,
|
| 34 |
GPT_55_MODEL_ID,
|
| 35 |
+
HY3_MODEL_ID,
|
| 36 |
KIMI_K27_CODE_MODEL_ID,
|
| 37 |
MINIMAX_M3_MODEL_ID,
|
| 38 |
strip_huggingface_model_prefix,
|
|
|
|
| 44 |
# ":cheapest", ":preferred", or ":<provider>" to override the default routing
|
| 45 |
# policy (auto = fastest with failover).
|
| 46 |
SUGGESTED_MODELS = [
|
| 47 |
+
{"id": HY3_MODEL_ID, "label": "Tencent Hy3 (Free)"},
|
| 48 |
+
{"id": GEMMA_4_31B_MODEL_ID, "label": "Gemma 4 31B"},
|
| 49 |
{"id": CLAUDE_OPUS_48_MODEL_ID, "label": "Claude Opus 4.8"},
|
| 50 |
{"id": GPT_55_MODEL_ID, "label": "GPT-5.5"},
|
| 51 |
{"id": MINIMAX_M3_MODEL_ID, "label": "MiniMax M3"},
|
|
|
|
| 172 |
)
|
| 173 |
|
| 174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
async def _probe_local_model(model_id: str) -> None:
|
| 176 |
params = _resolve_llm_params(model_id)
|
| 177 |
await asyncio.wait_for(
|
|
|
|
| 282 |
else:
|
| 283 |
session.model_effective_effort.pop(model_id, None)
|
| 284 |
else:
|
| 285 |
+
config.model_name = model_id
|