Repository navigation
feat(llm): add built-in Eden AI provider preset - #346
Conversation
Eden AI (https://www.edenai.co) is an OpenAI-compatible aggregator that exposes 100+ models from multiple providers through a single EU-hosted endpoint and API key. Registers it as a built-in provider preset (protocol openai, base URL https://api.edenai.run/v3, key via EDENAI_API_KEY), mirroring the existing OpenAI-compatible presets. Models use Eden AI's provider/model naming. Updates the provider registry tests accordingly. Signed-off-by: Victor M. SMITH <[email protected]>
|
✅ OpenCodeReview: No comments generated. Looks good to me. |
lizhengfeng101
left a comment
There was a problem hiding this comment.
Code Review
Overall
Clean, well-structured PR that follows the existing OpenAI-compatible provider pattern exactly. The two-file change is minimal and focused. Test updates are correct — "edenai" is inserted in the right alphabetical position in TestListProviders_Order.
Issue: Outdated Model List
The curated model list appears to be significantly behind what vendors currently recommend. Comparing against this project's own provider registry:
| Vendor | This repo's current provider list | Eden AI PR proposes |
|---|---|---|
| Anthropic | claude-opus-4-8, claude-opus-4-7, claude-opus-4-6, claude-sonnet-4-6 |
claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5 |
| OpenAI | gpt-5.5, gpt-5.4, gpt-5.4-mini |
gpt-5.1, gpt-5.1-codex |
The Anthropic models in the PR are 3 generations behind the latest Opus (4.5 vs 4.8) and 1 generation behind on Sonnet (4.5 vs 4.6). The OpenAI models are similarly outdated (5.1 vs 5.4/5.5). These older model versions are generally no longer recommended by the vendors themselves.
Suggestion: Update the model list to reflect current recommended models. For example:
Models: []string{
"anthropic/claude-opus-4-8",
"anthropic/claude-sonnet-4-6",
"anthropic/claude-haiku-4-5",
"openai/gpt-5.5",
"openai/gpt-5.4-mini",
"google/gemini-3.1-pro-preview",
"mistral/devstral-medium-latest",
"mistral/codestral-latest",
"deepseek/deepseek-v4-pro",
"xai/grok-4",
},Of course, the exact model IDs depend on what Eden AI actually supports via its provider/model routing — please verify against Eden AI's /v3/models endpoint and update accordingly.
Minor
- BaseURL
/v3: Other OpenAI-compatible providers in this project use/v1. The PR description confirms/v3/chat/completionsworks, so this is fine — just noting the difference. - Everything else (env var naming, no hardcoded secrets, test coverage) looks good.
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.
Eden AI (https://www.edenai.co) is an OpenAI-compatible aggregator that exposes 100+ models from multiple providers through a single EU-hosted endpoint and API key. Registers it as a built-in provider preset (protocol openai, base URL https://api.edenai.run/v3, key via EDENAI_API_KEY), mirroring the existing OpenAI-compatible presets. Models use Eden AI's provider/model naming. Updates the provider registry tests accordingly. Signed-off-by: Victor M. SMITH <[email protected]>
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.
Description
Adds Eden AI (https://www.edenai.co) as a built-in provider preset in
internal/llm/providers.go, as discussed in #338. Eden AI is an OpenAI-compatible aggregator that exposes 100+ models from many providers (OpenAI, Anthropic, Google, Mistral, DeepSeek, xAI, …) through a single EU-hosted endpoint and one API key. Models use theprovider/modelnaming scheme.Mirrors the existing OpenAI-compatible presets (same shape as the recently added Ollama Cloud preset #310):
Protocol: openaiBaseURL: https://api.edenai.run/v3EnvVar: EDENAI_API_KEYModelslist (anthropic/claude-sonnet-4-5,openai/gpt-5.1-codex,mistral/codestral-latest,deepseek/deepseek-v4-pro, …)From a user's perspective:
ocr config provider→ pick Eden AI → supply a key (or setEDENAI_API_KEY) → done.Closes #338
Testing
go build ./...andgo test ./internal/llm/pass (the provider-registry tests were updated to includeedenai).gofmt/go vetclean./v3/chat/completionsand/v3/modelsboth 200).EDENAI_API_KEY; never hardcoded.Happy to adjust the curated model list to your preference.