Skip to content

feat(llm): allow any OpenAI-compatible endpoint via env-var base-url override - #1033

Closed
sudo-ai-git wants to merge 1 commit into
caura-ai:mainfrom
sudo-ai-git:feat/openai-compatible-endpoint
Closed

sudo-ai-git wants to merge 1 commit into
caura-ai:mainfrom
sudo-ai-git:feat/openai-compatible-endpoint

Conversation

@sudo-ai-git

Copy link
Copy Markdown

Closes #992

Problem: the chat LLM path (dedup judge, enrichment, contradiction detection, entity extraction) hardcoded provider base URLs in common/llm/constants.py, so it could not target a custom OpenAI-compatible endpoint — the call failed, call_with_fallback walked to the fake provider, and LLM features silently ran on heuristics.

Change: add _env_base_url(provider) in common/llm/_credentials.py, honoring OPENAI_BASE_URL / ANTHROPIC_BASE_URL / OPENROUTER_BASE_URL, with the module constant as fallback. resolve_openai_compatible now returns the override when set.

Verified:

  • no override -> https://api.openai.com/v1 (backward compatible)
  • OPENAI_BASE_URL=https://compatible.example/v1 -> returned verbatim

Focused 1-file change (+18/-3). Happy to add a regression test + surface a tenant-config option if maintainers want it wired further.

…override

Closes caura-ai#992. The chat LLM path (dedup judge, enrichment, contradiction
detection, entity extraction) hardcoded provider base URLs, so it could not
target a custom OpenAI-compatible endpoint and silently fell back to
heuristics. Add _env_base_url() honoring OPENAI_BASE_URL / ANTHROPIC_BASE_URL /
OPENROUTER_BASE_URL, with the module constant as fallback. Backward compatible.
Verified: no override -> constant; override -> custom endpoint.
@sudo-ai-git
sudo-ai-git requested a review from a team as a code owner August 28, 2026 04:39
@Eldad-Caura

Copy link
Copy Markdown
Member

Thank you for tackling OpenAI-compatible endpoints. We are consolidating #992 in #993, which covers both configurable base URLs and the incompatible response_format behavior with broader tests; this PR addresses only the URL half. Closing this as superseded so the repository has one implementation path.

@Eldad-Caura Eldad-Caura closed this Sep 5, 2026
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.

[Feature] let the chat LLM path use any OpenAI-compatible endpoint

2 participants