Agent Zero AI framework
Default chat-only providers to Chat Completions
Alessandro0c663403a3cc
diff --git a/conf/AGENTS.md b/conf/AGENTS.mdindex 14b08e363..f01e9488f 100644--- a/conf/AGENTS.md+++ b/conf/AGENTS.md@@ -16,6 +16,7 @@- Do not commit API keys, provider secrets, local account identifiers, or private endpoints.- Keep provider IDs and settings keys stable unless all loaders, UI references, migrations, and tests are updated.- Defaults must work in a clean checkout and in Docker.+- Providers without a native Responses path in the supported LiteLLM runtime, or intentionally standardized on Chat Completions, must set `a0_api_mode: chat`; native Responses providers rely on the Responses default.- Templates must avoid accidentally unignoring private runtime content.## Work Guidancediff --git a/conf/model_providers.yaml b/conf/model_providers.yamlindex 8622f2baa..d1394d708 100644--- a/conf/model_providers.yaml+++ b/conf/model_providers.yaml@@ -32,6 +32,7 @@ chat:models_list:endpoint_url: "https://api.venice.ai/api/v1/models"kwargs:+ a0_api_mode: chatapi_base: https://llm.agent-zero.ai/v1venice_parameters:include_venice_system_prompt: false@@ -42,6 +43,8 @@ chat:endpoint_url: "https://api.anthropic.com/v1/models"params:limit: "1000"+ kwargs:+ a0_api_mode: chatcerebras:name: Cerebraslitellm_provider: cerebras@@ -55,11 +58,15 @@ chat:litellm_provider: cometapimodels_list:endpoint_url: "https://api.cometapi.com/v1/models"+ kwargs:+ a0_api_mode: chatdeepseek:name: DeepSeeklitellm_provider: deepseekmodels_list:endpoint_url: "https://api.deepseek.com/models"+ kwargs:+ a0_api_mode: chatgithub_copilot:name: GitHub Copilotlitellm_provider: github_copilot@@ -77,14 +84,20 @@ chat:params:pageSize: "1000"default_base: "https://generativelanguage.googleapis.com"+ kwargs:+ a0_api_mode: chatgroq:name: Groqlitellm_provider: groqmodels_list:endpoint_url: "https://api.groq.com/openai/v1/models"+ kwargs:+ a0_api_mode: chathuggingface:name: HuggingFacelitellm_provider: huggingface+ kwargs:+ a0_api_mode: chatlm_studio:name: LM Studiolitellm_provider: lm_studio@@ -110,23 +123,30 @@ chat:litellm_provider: mistralmodels_list:endpoint_url: "https://api.mistral.ai/v1/models"+ kwargs:+ a0_api_mode: chatmoonshot:name: Moonshot AIlitellm_provider: moonshotmodels_list:endpoint_url: "https://api.moonshot.cn/v1/models"+ kwargs:+ a0_api_mode: chatnebius:name: Nebius Token Factorylitellm_provider: openaimodels_list:endpoint_url: "/models"kwargs:+ a0_api_mode: chatapi_base: https://api.tokenfactory.nebius.com/v1nvidia_nim:name: NVIDIA NIMlitellm_provider: nvidia_nimmodels_list:endpoint_url: "https://integrate.api.nvidia.com/v1/models"+ kwargs:+ a0_api_mode: chatollama:name: Ollamalitellm_provider: ollama@@ -170,12 +190,15 @@ chat:bedrock:name: AWS Bedrocklitellm_provider: bedrock+ kwargs:+ a0_api_mode: chatopenrouter:name: OpenRouterlitellm_provider: openroutermodels_list:endpoint_url: "https://openrouter.ai/api/v1/models"kwargs:+ a0_api_mode: chatextra_headers:"HTTP-Referer": "https://agent-zero.ai/""X-Title": "Agent Zero"@@ -185,6 +208,8 @@ chat:litellm_provider: sambanovamodels_list:endpoint_url: "https://api.sambanova.ai/v1/models"+ kwargs:+ a0_api_mode: chatvenice:name: Venice.ailitellm_provider: openai@@ -210,12 +235,15 @@ chat:litellm_provider: xaimodels_list:endpoint_url: "https://api.x.ai/v1/models"+ kwargs:+ a0_api_mode: chatzai:name: Z.AIlitellm_provider: openaimodels_list:endpoint_url: "/models"kwargs:+ a0_api_mode: chatapi_base: https://api.z.ai/api/paas/v4zai_coding:name: Z.AI Coding@@ -223,6 +251,7 @@ chat:models_list:endpoint_url: "/models"kwargs:+ a0_api_mode: chatapi_base: https://api.z.ai/api/coding/paas/v4other:name: Other OpenAI compatiblediff --git a/plugins/_oauth/AGENTS.md b/plugins/_oauth/AGENTS.mdindex f7d10aa12..8e5f32e07 100644--- a/plugins/_oauth/AGENTS.md+++ b/plugins/_oauth/AGENTS.md@@ -46,6 +46,7 @@- Codex Responses proxy requests must include Codex client metadata and compatibility headers such as `client_metadata`, `x-codex-installation-id`, `originator`, `session-id`, and `thread-id`, and must forward `input` as a list for upstream Codex compatibility.- Codex Responses proxy requests must translate the legacy top-level `reasoning_effort` field to `reasoning.effort`; an explicit native `reasoning` field takes precedence.- Codex Responses proxy defaults for reasoning effort, reasoning summary, and text verbosity come from the `codex` plugin config; explicit native request values take precedence.+- OAuth providers without upstream Responses support must set `a0_api_mode: chat`; native Responses providers rely on the default, since a local proxy route alone does not prove upstream support.## Work Guidancediff --git a/plugins/_oauth/conf/model_providers.yaml b/plugins/_oauth/conf/model_providers.yamlindex c34d9c358..b9b4d65fb 100644--- a/plugins/_oauth/conf/model_providers.yaml+++ b/plugins/_oauth/conf/model_providers.yaml@@ -22,6 +22,7 @@ chat:models_list:endpoint_url: "/models"kwargs:+ a0_api_mode: chatapi_base: "http://127.0.0.1/oauth/gemini-api/v1"xai_grok_oauth:name: xAI Grok Accountdiff --git a/tests/test_model_config_api_keys.py b/tests/test_model_config_api_keys.pyindex 6f8fba928..fdc4190a8 100644--- a/tests/test_model_config_api_keys.py+++ b/tests/test_model_config_api_keys.py@@ -356,7 +356,7 @@ def test_direct_venice_chat_provider_defaults_to_chat_completions(monkeypatch):assert venice["kwargs"]["venice_parameters"] == {"include_venice_system_prompt": False}- assert "a0_api_mode" not in provider_config["chat"]["a0_venice"]["kwargs"]+ assert provider_config["chat"]["a0_venice"]["kwargs"]["a0_api_mode"] == "chat"assert "a0_api_mode" not in provider_config["embedding"]["venice"]["kwargs"]model = models.get_chat_model("venice", "llama-3.3-70b")@@ -485,6 +485,57 @@ def test_local_chat_providers_default_to_chat_completions():assert "a0_api_mode" not in provider_config["embedding"][provider]["kwargs"]+def test_provider_api_mode_defaults_use_intended_transport():+ import yaml++ provider_config = yaml.safe_load(+ (PROJECT_ROOT / "conf" / "model_providers.yaml").read_text(encoding="utf-8")+ )+ oauth_provider_config = yaml.safe_load(+ (+ PROJECT_ROOT+ / "plugins"+ / "_oauth"+ / "conf"+ / "model_providers.yaml"+ ).read_text(encoding="utf-8")+ )++ chat_providers = (+ "anthropic",+ "cometapi",+ "deepseek",+ "google",+ "groq",+ "huggingface",+ "mistral",+ "moonshot",+ "nebius",+ "nvidia_nim",+ "bedrock",+ "openrouter",+ "sambanova",+ "xai",+ "zai",+ "zai_coding",+ )+ responses_providers = ("azure", "github_copilot", "openai")++ for provider in chat_providers:+ assert provider_config["chat"][provider]["kwargs"]["a0_api_mode"] == "chat"++ for provider in responses_providers:+ assert "a0_api_mode" not in provider_config["chat"][provider].get("kwargs", {})++ assert (+ oauth_provider_config["chat"]["gemini_api_oauth"]["kwargs"]["a0_api_mode"]+ == "chat"+ )++ for provider in ("codex_oauth", "github_copilot_oauth", "xai_grok_oauth"):+ assert "a0_api_mode" not in oauth_provider_config["chat"][provider]["kwargs"]++def test_missing_api_key_banner_does_not_include_auto_modal_metadata(monkeypatch):from plugins._model_config.helpers import model_config