Repository navigation
feat: support OpenAI-compatible endpoints via backends.openai.baseUrl - #17
Merged
Merged
Conversation
The openai backend can now call any server that implements Chat Completions, such as OpenRouter, Ollama, LM Studio or Gemini's OpenAI endpoint. - backends.openai.baseUrl (http(s) only, no credentials, query or fragment); JUNTO_OPENAI_BASE_URL overrides it. The default stays api.openai.com. - No key is needed for a localhost/127.0.0.1/[::1] baseUrl; no Authorization header is sent without one. Remote endpoints still require the key. - Responses without usage or model no longer throw. - README documents the four servers; CLAUDE.md status now describes 0.6.2.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
openaiadvisory backend can now talk to any OpenAI-compatible server: OpenRouter, Ollama,LM Studio, Gemini's OpenAI endpoint, and similar.
backends.openai.baseUrl(default stayshttps://api.openai.com/v1). Trailingslashes are ignored; it must be http(s) and may not contain credentials, a query or a fragment.
JUNTO_OPENAI_BASE_URLoverrides it per machine/shell (follows the existingJUNTO_*naming;OPENAI_BASE_URLis not reused so other tools' settings don't silently redirect junto's calls).<baseUrl>/chat/completions), which these serversimplement, so no API switch was needed.
localhost,127.0.0.1or[::1]baseUrl the key is optional and noAuthorizationheader is sent without one. Remote endpoints still require the key.usage/model(some compatible servers) no longer throw; they count as 0 tokens.baseUrlonbackends.anthropicis rejected.Verification
pnpm typecheckpasses;pnpm test: 396 passed, 4 skipped (new mocked-fetch tests for URLbuilding, header omission, env override, loopback key rule, validation, schema).
pnpm build, rebuiltplugin/hooksandplugin/mcpcommitted;git diff --exit-code -- plugin/hooks plugin/mcpis clean.