refactor: Centralize strix model resolution with separate API and capability names

- Replace fragile prefix matching with explicit STRIX_MODEL_MAP
- Add resolve_strix_model() returning (api_model, canonical_model)
- api_model (openai/ prefix) for API calls to OpenAI-compatible Strix API
- canonical_model (actual provider name) for litellm capability lookups
- Centralize resolution in LLMConfig instead of scattered call sites
This commit is contained in:
0xallam
2026-02-20 04:40:04 -08:00
parent 6b0a5e2b6a
commit d2a48e7a6f
6 changed files with 45 additions and 42 deletions
+3 -2
View File
@@ -19,7 +19,7 @@ from rich.text import Text
from strix.config import Config, apply_saved_config, save_current_config
from strix.config.config import resolve_llm_config
from strix.llm.utils import get_litellm_model_name
from strix.llm.utils import resolve_strix_model
apply_saved_config()
@@ -210,6 +210,8 @@ async def warm_up_llm() -> None:
try:
model_name, api_key, api_base = resolve_llm_config()
litellm_model, _ = resolve_strix_model(model_name)
litellm_model = litellm_model or model_name
test_messages = [
{"role": "system", "content": "You are a helpful assistant."},
@@ -218,7 +220,6 @@ async def warm_up_llm() -> None:
llm_timeout = int(Config.get("llm_timeout") or "300")
litellm_model = get_litellm_model_name(model_name) or model_name
completion_kwargs: dict[str, Any] = {
"model": litellm_model,
"messages": test_messages,