feat(providers): add Eden AI provider#193
Open
MVS-source wants to merge 1 commit into
Open
Conversation
Eden AI (https://www.edenai.co) is an OpenAI-compatible aggregator exposing 100+ models from many providers through a single EU-hosted endpoint and API key. Adds EdenAIProvider (cascadeflow/providers/edenai.py) mirroring the existing OpenAI-compatible providers, registers it in the provider registry, and documents the EDENAI_API_KEY in .env.example. The provider reads the per-request cost returned by the Eden AI API when present and falls back to a local pricing table otherwise. Models use Eden AI's provider/model naming. - API key via EDENAI_API_KEY env var only (never hardcoded or logged) - Streaming + tool-calling supported - Adds tests/test_edenai.py (11 tests, all passing) Signed-off-by: Victor M. SMITH <72023257+MVS-source@users.noreply.github.com>
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 Eden AI (https://www.edenai.co) as a native provider. Eden AI is an OpenAI-compatible aggregator that exposes 100+ models from many providers (OpenAI, Anthropic, Google, Mistral, DeepSeek, X.AI, …) through a single EU-hosted endpoint and one API key.
EdenAIProvidermirrors the existing OpenAI-compatible providers (closest analog:OpenRouterProvider). Because Eden AI returns the actual per-request cost in each response, the provider uses that value for accurate accounting and falls back to a local pricing table when it's absent. Follows the "Adding a New Provider" checklist in CONTRIBUTING.🔄 Type of Change
🧪 Testing
Test cases added
tests/test_edenai.py, 11 tests: init, completion, system prompt, API-cost vs local-pricing fallback, 401, 429, cost estimation)How to test
Verified locally:
pytest tests/test_edenai.py→ 11 passed; existing provider tests (groq/openai/ollama) → 49 passed, 1 skipped (no regressions);black/ruffclean. Live run:complete,stream, andfetch_available_models(763 models) all working; cost read from the API response.📝 Notes
provider/modelformat (e.g.mistral/codestral-latest).EDENAI_API_KEYonly — never hardcoded or logged.https://api.edenai.run/v3(EU-only endpoint available athttps://api.eu.edenai.run/v3).