Repository navigation
feat: add LiteLLM AI gateway provider preset - #385
Merged
lizhengfeng101 merged 1 commit intoJul 17, 2026
Merged
Conversation
Contributor
|
✅ OpenCodeReview: No comments generated. Looks good to me. |
Closed
This was referenced Aug 7, 2026
lizhengfeng101
pushed a commit
that referenced
this pull request
Aug 8, 2026
Add Mistral AI to the provider registry using the existing OpenAI-compatible chat completions protocol. Mistral's endpoint at https://api.mistral.ai/v1 speaks the same request/response shape, so no client code or new protocol constant is required — this is a registry-only addition matching the pattern established by the recently merged Eden AI (#346), Ollama Cloud (#375), and LiteLLM (#385) provider presets. Auth via MISTRAL_API_KEY. Curated model list kept deliberately minimal (codestral-latest, mistral-large-latest, mistral-small-latest); users can select any other Mistral model via `ocr config set model <name>`. Tested end-to-end against api.mistral.ai with codestral-latest against a staged diff — review returned an accurate high-severity SQL injection finding with a correct parameterized-query fix suggestion.
Githab-capibara
added a commit
to Githab-capibara/open-code-review
that referenced
this pull request
Sep 17, 2026
Githab-capibara
added a commit
to Githab-capibara/open-code-review
that referenced
this pull request
Sep 17, 2026
Add Mistral AI to the provider registry using the existing OpenAI-compatible chat completions protocol. Mistral's endpoint at https://api.mistral.ai/v1 speaks the same request/response shape, so no client code or new protocol constant is required — this is a registry-only addition matching the pattern established by the recently merged Eden AI (alibaba#346), Ollama Cloud (alibaba#375), and LiteLLM (alibaba#385) provider presets. Auth via MISTRAL_API_KEY. Curated model list kept deliberately minimal (codestral-latest, mistral-large-latest, mistral-small-latest); users can select any other Mistral model via `ocr config set model <name>`. Tested end-to-end against api.mistral.ai with codestral-latest against a staged diff — review returned an accurate high-severity SQL injection finding with a correct parameterized-query fix suggestion.
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.
Description
Adds LiteLLM as a built-in provider preset, giving users access to 100+ LLM providers (Anthropic, OpenAI, Bedrock, Vertex AI, Groq, Mistral, etc.) through a single proxy endpoint.
LiteLLM is a widely-adopted AI gateway (45k+ GitHub stars) that normalizes provider-specific auth and API formats server-side, exposing a standard OpenAI-compatible endpoint.
Changes (2 files, 67 insertions):
internal/llm/providers.go- Addedlitellmprovider entry withProtocolOpenAIChatCompletions, base URLhttp://localhost:4000/v1, env varLITELLM_API_KEY, and 12 representative models spanning 7 backing providers (Anthropic, OpenAI, Vertex AI, Bedrock, Groq, Mistral, DeepSeek)internal/llm/providers_test.go- UpdatedTestListProviders_Ordersorted list, addedTestLookupProvider_LiteLLMDetailswith full field and model list verificationType of Change
How Has This Been Tested?
make testpasses locallyUnit tests (36 tests, 0 regressions):
Format + vet:
make check->check passedLive E2E (Azure Foundry Claude Sonnet 4.6 via LiteLLM proxy):
Checklist
go fmt,go vet)Example usage