Skip to content

Fix custom OpenAI-compatible gateway routing#442

Open
Beandon13 wants to merge 1 commit into
aliasrobotics:mainfrom
Beandon13:fix/openai-compatible-gateway-414-20260504202003
Open

Fix custom OpenAI-compatible gateway routing#442
Beandon13 wants to merge 1 commit into
aliasrobotics:mainfrom
Beandon13:fix/openai-compatible-gateway-414-20260504202003

Conversation

@Beandon13
Copy link
Copy Markdown

Summary

  • honor OPENAI_API_BASE and generic OPENAI_BASE_URL as OpenAI-compatible gateway overrides, not just OLLAMA_API_BASE
  • route unknown provider/model prefixes through the user-configured OpenAI-compatible base instead of letting LiteLLM misclassify the left-hand side as a provider
  • add regressions for env-var priority and custom-prefixed gateway models

Testing

  • OPENAI_API_KEY=test-key pytest tests/core/test_openai_chatcompletions.py -q -k 'get_ollama_api_base_prefers_openai_compatible_env_vars or routes_unknown_prefixed_models_to_openai_compatible_base'
  • git diff --check
  • python3 -m compileall src/cai/util.py src/cai/sdk/agents/models/openai_chatcompletions.py tests/core/test_openai_chatcompletions.py

Closes #414

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom OpenAI-Compatible Gateway Not Recognized Properly / Connection Error

1 participant