feat(core): add Eden AI as a built-in model provider

MV
3mo ago
+335-0

What

Adds Eden AI as a built-in model provider.

Eden AI is an EU-based, OpenAI-compatible LLM gateway (single API key, one endpoint, many upstream vendors). Because it speaks the OpenAI-compatible protocol, it slots into the existing EXTRA_PROVIDER_REGISTRY and is wired through the shared @ai-sdk/openai-compatible adapter, exactly like the MiniMax entries. No new adapter code is required.

Usage

const agent = new Agent({
  name: "Eden AI Assistant",
  instructions: "You are a helpful assistant powered by Eden AI.",
  model: "edenai/openai/gpt-4o-mini",
});

Eden AI model ids are vendor-prefixed, so the full router id is edenai/<vendor>/<model>, for example:

  • edenai/openai/gpt-4o-mini
  • edenai/anthropic/claude-haiku-4-5
  • edenai/mistral/mistral-small-latest

The provider reads EDENAI_API_KEY and defaults to https://api.edenai.run/v3. Set EDENAI_BASE_URL=https://api.eu.edenai.run/v3 for EU data residency. The registry splits on the first slash, so the edenai segment is the provider and the remaining <vendor>/<model> is passed straight through to Eden AI.

Changes

  • packages/core/src/registries/model-provider-registry.ts: one EXTRA_PROVIDER_REGISTRY entry (id: "edenai", @ai-sdk/openai-compatible, api: https://api.edenai.run/v3, env: ["EDENAI_API_KEY"]).
  • packages/core/src/registries/model-provider-registry-edenai.spec.ts: unit tests mirroring the MiniMax spec (provider is registered, resolves through @ai-sdk/openai-compatible with the right base URL and API key, keeps the vendor-prefixed model id after the provider segment, honors EDENAI_BASE_URL, throws when the key is missing).
  • examples/with-edenai/: runnable example mirroring examples/with-openrouter.
  • .changeset/edenai-provider.md: patch changeset for @voltagent/core.

Testing

  • Unit: the new spec and the existing MiniMax spec both pass (vitest run on the registry specs, 13 tests).
  • Live: verified end to end against the real Eden AI API with a real key, reproducing the registry adapter path (createOpenAICompatible({ name: "edenai", baseURL: "https://api.edenai.run/v3", apiKey })) and generateText from ai@6. Three upstream vendors returned completions: openai/gpt-4o-mini, anthropic/claude-haiku-4-5, mistral/mistral-small-latest.
  • Lint/format: biome check clean; example typechecks with tsc --noEmit.

Summary by cubic

Add Eden AI as a built-in model provider via the @ai-sdk/openai-compatible adapter, enabling models addressed as edenai/<vendor>/<model> with EU endpoint support. Includes a runnable example and unit tests; no new adapter code.

  • New Features
    • Register edenai in EXTRA_PROVIDER_REGISTRY with API https://api.edenai.run/v3; reads EDENAI_API_KEY and supports EDENAI_BASE_URL.
    • Preserve vendor-prefixed ids after edenai/ (e.g. edenai/openai/gpt-4o-mini).
    • Add examples/with-edenai and a spec verifying registration, base URL override, and missing-key errors.

Summary by CodeRabbit

  • New Features

    • Added built-in Eden AI model provider support.
    • Use vendor-prefixed model IDs such as edenai/openai/gpt-4o-mini.
    • Configure access with EDENAI_API_KEY; optional EU routing is supported through EDENAI_BASE_URL.
    • Added a complete Eden AI example application with memory, logging, and server integration.
  • Documentation

    • Added setup instructions, configuration guidance, and usage details for Eden AI.