mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-09 17:08:29 +00:00
Default local providers to chat completions
Force chat-completions transport by default for local and broad OpenAI-compatible chat providers whose Responses API implementations are often missing or unstable.\n\nCovers LM Studio, llama.cpp, Ollama, Ollama Cloud, oMLX, vLLM, and Other OpenAI compatible while leaving embedding provider defaults untouched. Updates provider-default regression coverage for the new chat-only defaults.
This commit is contained in:
parent
ad148f24cc
commit
7aba42d46e
2 changed files with 39 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ chat:
|
|||
endpoint_url: "/v1/models"
|
||||
default_base: "http://host.docker.internal:1234"
|
||||
kwargs:
|
||||
a0_api_mode: chat
|
||||
api_base: "http://host.docker.internal:1234/v1"
|
||||
api_key: "lm-studio"
|
||||
llama_cpp:
|
||||
|
|
@ -93,6 +94,7 @@ chat:
|
|||
endpoint_url: "/v1/models"
|
||||
default_base: "http://host.docker.internal:8080"
|
||||
kwargs:
|
||||
a0_api_mode: chat
|
||||
api_base: "http://host.docker.internal:8080/v1"
|
||||
api_key: "llama-cpp"
|
||||
mistral:
|
||||
|
|
@ -120,6 +122,7 @@ chat:
|
|||
format: "ollama"
|
||||
default_base: "http://host.docker.internal:11434"
|
||||
kwargs:
|
||||
a0_api_mode: chat
|
||||
api_base: "http://host.docker.internal:11434"
|
||||
omlx:
|
||||
name: oMLX
|
||||
|
|
@ -128,6 +131,7 @@ chat:
|
|||
endpoint_url: "/v1/models"
|
||||
default_base: "http://host.docker.internal:8000"
|
||||
kwargs:
|
||||
a0_api_mode: chat
|
||||
api_base: "http://host.docker.internal:8000/v1"
|
||||
api_key: "omlx"
|
||||
ollama_cloud:
|
||||
|
|
@ -136,6 +140,7 @@ chat:
|
|||
models_list:
|
||||
endpoint_url: "/models"
|
||||
kwargs:
|
||||
a0_api_mode: chat
|
||||
api_base: https://ollama.com/v1
|
||||
openai:
|
||||
name: OpenAI
|
||||
|
|
@ -184,6 +189,7 @@ chat:
|
|||
endpoint_url: "/v1/models"
|
||||
default_base: "http://host.docker.internal:8000"
|
||||
kwargs:
|
||||
a0_api_mode: chat
|
||||
api_base: "http://host.docker.internal:8000/v1"
|
||||
api_key: "vllm"
|
||||
xai:
|
||||
|
|
@ -208,6 +214,8 @@ chat:
|
|||
other:
|
||||
name: Other OpenAI compatible
|
||||
litellm_provider: openai
|
||||
kwargs:
|
||||
a0_api_mode: chat
|
||||
|
||||
embedding:
|
||||
huggingface:
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@ def test_ollama_cloud_provider_config_requires_key_and_base_url():
|
|||
ollama_cloud = provider_config["chat"]["ollama_cloud"]
|
||||
|
||||
assert ollama_cloud["name"] == "Ollama Cloud"
|
||||
assert ollama_cloud["kwargs"]["a0_api_mode"] == "chat"
|
||||
assert ollama_cloud["kwargs"]["api_base"] == "https://ollama.com/v1"
|
||||
assert ollama_cloud["models_list"]["endpoint_url"] == "/models"
|
||||
assert "api_key_mode" not in ollama_cloud
|
||||
|
|
@ -298,6 +299,36 @@ def test_direct_venice_chat_provider_defaults_to_chat_completions(monkeypatch):
|
|||
assert custom.kwargs["a0_api_mode"] == "responses"
|
||||
|
||||
|
||||
def test_local_chat_providers_default_to_chat_completions():
|
||||
import yaml
|
||||
|
||||
provider_path = PROJECT_ROOT / "conf/model_providers.yaml"
|
||||
provider_config = yaml.safe_load(provider_path.read_text(encoding="utf-8"))
|
||||
|
||||
chat_completions_default_providers = (
|
||||
"lm_studio",
|
||||
"llama_cpp",
|
||||
"ollama",
|
||||
"ollama_cloud",
|
||||
"omlx",
|
||||
"other",
|
||||
"vllm",
|
||||
)
|
||||
local_embedding_providers = (
|
||||
"lm_studio",
|
||||
"llama_cpp",
|
||||
"ollama",
|
||||
"omlx",
|
||||
"vllm",
|
||||
)
|
||||
|
||||
for provider in chat_completions_default_providers:
|
||||
assert provider_config["chat"][provider]["kwargs"]["a0_api_mode"] == "chat"
|
||||
|
||||
for provider in local_embedding_providers:
|
||||
assert "a0_api_mode" not in provider_config["embedding"][provider]["kwargs"]
|
||||
|
||||
|
||||
def test_missing_api_key_banner_does_not_include_auto_modal_metadata(monkeypatch):
|
||||
from plugins._model_config.helpers import model_config
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue