Skip to content

feat(providers): add Eden AI provider#193

Open
MVS-source wants to merge 1 commit into
lemony-ai:mainfrom
MVS-source:feat/edenai-provider
Open

feat(providers): add Eden AI provider#193
MVS-source wants to merge 1 commit into
lemony-ai:mainfrom
MVS-source:feat/edenai-provider

Conversation

@MVS-source

Copy link
Copy Markdown

🎯 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.

EdenAIProvider mirrors 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

  • 🚀 New provider integration
  • ✅ Test additions/improvements
  • 📝 Documentation update

🧪 Testing

Test cases added

  • Unit tests (tests/test_edenai.py, 11 tests: init, completion, system prompt, API-cost vs local-pricing fallback, 401, 429, cost estimation)
  • Manual testing (live end-to-end against the Eden AI API)

How to test

import asyncio
from cascadeflow.providers import EdenAIProvider  # uses EDENAI_API_KEY env var

async def main():
    p = EdenAIProvider()
    r = await p.complete(prompt="Hello!", model="anthropic/claude-sonnet-4-5")
    print(r.provider, r.model, r.cost, r.content)
    await p.close()

asyncio.run(main())

Verified locally: pytest tests/test_edenai.py → 11 passed; existing provider tests (groq/openai/ollama) → 49 passed, 1 skipped (no regressions); black/ruff clean. Live run: complete, stream, and fetch_available_models (763 models) all working; cost read from the API response.

📝 Notes

  • Model naming uses Eden AI's provider/model format (e.g. mistral/codestral-latest).
  • API key read from EDENAI_API_KEY only — never hardcoded or logged.
  • Base URL defaults to https://api.edenai.run/v3 (EU-only endpoint available at https://api.eu.edenai.run/v3).

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>
@MVS-source
MVS-source requested a review from saschabuehrle as a code owner July 9, 2026 09:01
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.

1 participant