mirror of
https://github.com/usestrix/strix.git
synced 2026-08-21 10:48:59 +02:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user