fix(agent): v4.15.5 - test de connexion provider ne fuit plus le modele global
- LLMClient : default_model scope par provider — tester nvidia alors que deepseek est le provider actif ne lui envoie plus 'deepseek-v4-flash' (cause du 404 'model not found' de NVIDIA) - presets NVIDIA actualises (anciens modeles retires de la plateforme / premium) - test de regression ajoute (46 passed)
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ async def lifespan(_app: FastAPI):
|
||||
|
||||
app = FastAPI(
|
||||
title="FlowDeck",
|
||||
version="4.15.4",
|
||||
version="4.15.5",
|
||||
docs_url="/docs" if settings.log_level == "DEBUG" else None,
|
||||
redoc_url=None,
|
||||
lifespan=lifespan,
|
||||
|
||||
@@ -34,7 +34,7 @@ PROVIDERS = {
|
||||
"google": ("https://generativelanguage.googleapis.com/v1beta", "gemini-2.0-pro"),
|
||||
"deepseek": ("https://api.deepseek.com/v1", "deepseek-chat"),
|
||||
"qwencloud": ("https://dashscope.aliyuncs.com/compatible-mode/v1", "qwen-max"),
|
||||
"nvidia": ("https://integrate.api.nvidia.com/v1", "nvidia/llama-3.1-70b-instruct"),
|
||||
"nvidia": ("https://integrate.api.nvidia.com/v1", "nvidia/nemotron-3-super-120b-a12b"),
|
||||
"openrouter": ("https://openrouter.ai/api/v1", "meta-llama/llama-3.3-70b-instruct"),
|
||||
"ollama": ("http://localhost:11434/v1", "llama3.1"),
|
||||
"offline": (None, None),
|
||||
@@ -47,7 +47,9 @@ PROVIDER_MODELS: dict[str, list[str]] = {
|
||||
"google": ["gemini-2.0-pro", "gemini-2.0-flash", "gemini-1.5-pro", "gemini-1.5-flash"],
|
||||
"deepseek": ["deepseek-chat", "deepseek-reasoner"],
|
||||
"qwencloud": ["qwen-max", "qwen-plus", "qwen-turbo", "qwen-long"],
|
||||
"nvidia": ["nvidia/llama-3.1-70b-instruct", "nvidia/nemotron-4-340b-instruct"],
|
||||
"nvidia": ["nvidia/nemotron-3-super-120b-a12b", "nvidia/nemotron-3-nano-30b-a3b",
|
||||
"meta/llama-3.1-70b-instruct", "nvidia/llama-3.3-nemotron-super-49b-v1.5",
|
||||
"deepseek-ai/deepseek-v4-pro", "z-ai/glm-5.2"],
|
||||
"openrouter": ["meta-llama/llama-3.3-70b-instruct", "anthropic/claude-3.5-sonnet",
|
||||
"openai/gpt-4o", "mistralai/mistral-large"],
|
||||
"ollama": ["llama3.1", "llama3", "mistral", "qwen2.5", "gemma2", "mixtral"],
|
||||
@@ -98,7 +100,12 @@ class LLMClient:
|
||||
self.api_base = api_base if api_base is not None else cfg["api_base"]
|
||||
base, model = PROVIDERS.get(self.provider, (None, None))
|
||||
self.api_base = self.api_base or base
|
||||
self.default_model = cfg["model"] or model or "gpt-4o"
|
||||
# Le modèle global configuré n'est valable que pour le provider global :
|
||||
# tester un autre provider (ex. nvidia alors que deepseek est actif) ne doit
|
||||
# PAS lui envoyer le modèle du provider actif (sinon « model not found »).
|
||||
cfg_provider = (cfg.get("provider") or "offline").lower()
|
||||
global_model = (cfg.get("model") or "") if self.provider == cfg_provider else ""
|
||||
self.default_model = global_model or model or "gpt-4o"
|
||||
|
||||
# ── Public API ──
|
||||
|
||||
|
||||
Reference in New Issue
Block a user