Add OpenAI-compatible agent profile#7
Conversation
|
Thanks — direction is great, two scoping nits before merge: 1. Rename to follow the provider-prefix convention. Existing env vars are
Bonus: every OpenAI-compatible tool (Ollama, LM Studio, copilot-api, vLLM) already calls them this, so it's instantly recognisable. 2. Scope the base_url env override to the new profile only. Today no profile lets you override Concretely: @property
def resolved_base_url(self) -> str | None:
if self.llm_profile == "openai_compatible":
return self.openai_base_url or None
return _LLM_PROFILES[self.llm_profile].get("base_url")That keeps every existing profile's resolution path untouched, gives the new profile the env-driven flexibility it needs, and the 2-line With those two changes I'd merge happily — the rest of the PR is good (regression coverage for existing profiles is a particularly nice touch). |
This is the focused follow-up from the closed local-agent setup PR. It only adds the generic
openai_compatibleprofile path, so BrainDB can point the internal agent at OpenAI-compatible/v1endpoints without adding another provider abstraction.What changed:
openai_compatibleto_LLM_PROFILESand letAGENT_BASE_URLoverride the profile base URLAGENT_BASE_URLandAGENT_API_KEYinto the API containerWhat this does not include:
local_ollamaaliasOPENAI_API_KEYpassthroughValidation:
python -m pytest tests/test_config_profiles.py -q-> 7 passeddocker compose configpython -m py_compile braindb/config.py tests/conftest.py tests/test_config_profiles.pyLLM_PROFILE=openai_compatible,AGENT_MODEL=openai/llama3.2:3b,AGENT_BASE_URL=http://localhost:11434/v1I could not run the full suite in this shell because the local Python environment is missing
agentsandpsycopg2; the targeted config tests above do not depend on those packages.