Skip to content

Feat/edenai provider - #3929

Open
YacineMK wants to merge 14 commits into
anomalyco:devfrom
YacineMK:feat/edenai-provider
Open

Feat/edenai provider#3929
YacineMK wants to merge 14 commits into
anomalyco:devfrom
YacineMK:feat/edenai-provider

Conversation

@YacineMK

@YacineMK YacineMK commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Adds Eden AI sync mechanism (provider scaffold, logo, sync module).

Eden AI is an EU-based AI aggregation platform that exposes 100+ models from many providers behind a single OpenAI-compatible API (https://api.edenai.run/v3, Authorization: Bearer,
provider/model format), with unified billing/usage tracking and EU data residency options. This adds the edenai provider using @ai-sdk/openai-compatible (no new dependency), matching
the pattern of existing aggregator entries like openrouter / kilo.

Changes

  • providers/edenai/provider.toml — provider entry
  • providers/edenai/logo.svg — monochrome logo (currentColor via SVG mask)
  • packages/core/src/sync/providers/edenai.ts — sync module modeled on openrouter.ts / llmgateway.ts
  • packages/core/src/sync/index.ts — registered in providers + aggregators group

Design notes

The sync treats Eden's /v3/models as authoritative only for cost, context, and modality data. Capability, open_weights, and reasoning-control fields default to safe values (false,
[]) when Eden's API doesn't provide them, following the llmgateway pattern. Existing hand-authored fields are preserved via context.existing().

Only text-output models are synced; specialty Eden endpoints (OCR, TTS, embeddings, sentiment) live on other Eden APIs and are out of scope.

Catalog

The generated catalog is ~800 files, which exceeds GitHub's 300-file PR-diff limit and would block the pr-reviewer workflow. Following the pattern from kilo #2997 and hyper #3352,
the catalog will land in a follow-up PR from an automation/sync-models-edenai branch that bypasses the reviewer by design.

To generate locally after merge:
bun models:sync edenai

Sources

Verification

  • bun models:sync edenai --dry-run → 796 planned, 0 errors
  • bun validate → passes
  • packages/sdk tests → 23/23 pass

Replace hardcoded #040F31 and #fff fills with a mask-based approach so
the logo adapts to light/dark themes per AGENTS.md logo guidelines.
The previous @media (prefers-color-scheme) rule did not work when the
logo is served as an <img src> asset.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] packages/core/src/sync/providers/edenai.ts:245 - Check: open_weights is model-intrinsic and must inherit via base_model when metadata exists; provider sync must not invent overrides. Why: Final code sets open_weights = existing?.open_weights ?? false and always passes it into factorBaseModel. For new factored models that becomes false, which overrides bases with open_weights = true (e.g. models/minimax/MiniMax-M2.1.toml). Patch 5 already produced that bad override (open_weights = false on minimax/MiniMax-M2.1). Hourly Eden sync will republish incorrect catalog data. Action: For factored entries omit open_weights (use undefined so metadata inherits), matching deepinfra/hyper. Only set open_weights on full inline models, and prefer existing?.open_weights there rather than a blanket false.
  • [medium] [possible mistake] packages/core/src/sync/providers/edenai.ts:366 - Check: PR design and AGENTS.md: Eden is authoritative for cost/context/modalities; capability fields should not blindly override models/ facts. Why: Factored path still injects Eden-derived reasoning, tool_call, structured_output, and attachment into factorBaseModel. Peers such as llmgateway pass only gateway-authoritative fields for new factored models. Noisy Eden flags can permanently override curated capabilities on first sync. Action: For resolvedBase !== undefined, limit overrides to cost, served limit.context, modalities (if treated as authoritative), dates, and reasoning_options when needed; leave other capabilities unset so they inherit.
  • [medium] [violation] packages/core/src/sync/providers/edenai.ts:1 - Check: New complex sync translators need focused regression coverage when they can corrupt catalog data. Why: buildEdenAIModel has no tests in packages/core/test/sync.test.ts, while similar aggregators (hyper, llmgateway) do. The open_weights/base_model bug would have been caught by a factored open-weight case. Action: Add unit tests for factored open-weight inheritance, missing output-limit handling, and full-inline fallbacks.
  • [low] [possible mistake] .github/workflows/sync-models.yml:73 - Check: New sync providers that need credentials must wire secrets into the hourly workflow (sync.md). Why: Fetch uses EDENAI_API_KEY when set, but the workflow never exports it. Final PR ships zero model TOMLs and relies on automation; if /v3/models requires auth in CI, Eden stays empty after merge. Action: Confirm unauthenticated catalog access in CI; if a key is required, add EDENAI_API_KEY to the sync job env (and repo secrets). Update the PR body to match the deferred-catalog approach.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] packages/core/src/sync/providers/edenai.ts:340 - Check: Provider-agnostic capabilities must not be clobbered with false defaults when factoring via base_model (see DeepInfra/LLM Gateway sync patterns and AGENTS.md merge rules). Why: reasoning, tool_call, and structured_output are set with === true (missing API flags become false), and open_weights defaults to false for new models. Those values are always passed into factorBaseModel(), so when Eden omits a capability the sync writes explicit false overrides that replace inherited metadata (e.g. open-weight or tool-capable bases). The PR itself notes Eden is not authoritative for capabilities, but the code still treats absences as negatives. Action: Only emit capability fields when Eden explicitly reports them (or when overriding a curated existing value). For resolved base_model entries, prefer the DeepInfra/LLM Gateway approach: override cost/limit/modalities (and provider-specific reasoning_options) and leave tool_call / reasoning / structured_output / open_weights unset so they inherit from models/.
  • [high] [violation] packages/core/src/sync/providers/edenai.ts:237 - Check: New provider models must use base_model when a matching models/<provider>/<model>.toml exists. Why: candidateBaseModels() only maps owned_by via DIRECT_METADATA_PROVIDER or bare/exact IDs. Gateway routes such as amazon/anthropic.claude-opus-4-6-v1 never resolve to anthropic/claude-opus-4-6 (Bedrock-style provider.model IDs, -v1:0, region suffixes). The initial sync catalog in this PR already produced full inline amazon/anthropic entries without base_model while models/anthropic/… exists—the same result automation will recreate after merge. Action: Extend resolution for gateway IDs (parse anthropic.* / meta.* / openai.* style names, strip Bedrock/region suffixes, reuse resolveCanonicalBaseModel / stronger aliases) so underlying canonical metadata is factored; add focused tests covering at least one amazon/anthropic and one direct anthropic/openai path.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] packages/core/src/sync/providers/edenai.ts:296 - Check: Factored base_model entries must keep attachment consistent with any modality overrides (or leave both unset so curated models/ metadata inherits). Why: The factored path always writes Eden modalities but never sets attachment, while the comment claims DeepInfra/LLM Gateway behavior—those peers leave modalities unset for new factored models. After merge, base attachment can disagree with Eden modalities (e.g. attachment = true with text-only input), so the automated catalog will ship inconsistent capability data. Action: Either omit modalities on the factored path so base metadata inherits, or set attachment from the same Eden input modalities whenever modalities are overridden.
  • [medium] [possible mistake] packages/core/src/sync/providers/edenai.ts:1 - Check: New sync modules with non-trivial ID resolution and factored/inline splits need focused regression coverage. Why: normalizeGatewayName, Bedrock candidate factoring, and the factored vs inline field split already required multiple fixup commits (output limits, open_weights, capability clobbering). Without unit tests, the deferred automation catalog is likely to reintroduce the same class of bugs. Action: Add focused buildEdenAIModel tests covering Bedrock-style IDs resolving to base_model, factored field selection (no fabricated limit.output / capability clobber), and attachment/modality consistency.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/edenai/logo.svg:1 - Check: New providers must ship a logo with no hardcoded colors; use currentColor for fills/strokes so it adapts when inlined. Why: The logo still hardcodes fill="white" / fill="black" inside a <mask>. Site rendering rewrites every non-currentColor fill to currentColor (packages/web/src/render.tsx providerLogoSvg), which collapses the mask cutouts into a solid rect and breaks the mark in the UI. Action: Replace the mask/cutout approach with a monochrome path (or equivalent) that uses only currentColor / none—no white/black fills—so the logo survives inlining and matches AGENTS.md.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

No actionable findings.

@YacineMK

YacineMK commented Aug 2, 2026

Copy link
Copy Markdown
Author

Friendly ping @rekram1-node CI is green (796 models planned, 0 errors on dry-run, all 23 SDK tests pass) This follows the same catalog-deferred pattern as #2997 (kilo) and #3352 (hyper) Happy to answer any questions

@MVS-source

Copy link
Copy Markdown

@rekram1-node could you take a look when you get a chance? This adds Eden AI as a sync provider (mirrors the OpenRouter/LLM Gateway pattern) and is needed to unblock Eden AI showing up as a provider in Kilo Code. Happy to help test or answer questions about the API responses.

@rekram1-node

Copy link
Copy Markdown
Collaborator

You can't make prs for adding a provider and then not add any models for it, it will break consumers of the api.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [high] [possible mistake] providers/edenai/models/xai/grok-4.toml:1 - Check: Provider model fields must be internally consistent and match the served model. Why: The entry’s description calls Grok 4 a reasoning model with structured outputs and image+text inputs, but the authored flags say reasoning = false, structured_output = false, attachment = false, and modalities.input = ["text"] only. Peer catalogs disagree on reasoning for this ID, but this file contradicts itself. Action: Reconcile capabilities/modalities (and description) against Eden’s actual /v3/models entry and first-party Grok 4 docs; if it reasons or accepts images, set the matching fields (and reasoning_options = [] when reasoning is true with no verified control).
  • [medium] [violation] providers/edenai/models/mistral/codestral-latest.toml:2 - Check: With base_model, provider-agnostic release_date should inherit from models/ unless the provider truly differs. Why: Seeds override canonical release dates with gateway/catalog dates: codestral-latest uses 2026-06-05 (base 2024-05-29), mistral-large-latest uses 2024-02-26 (base 2024-11-01), and MiniMax-M3 uses 2026-05-31 (base 2026-06-01). Those look like Eden listing/created timestamps, not model launches. Action: Drop the incorrect release_date overrides from those seed TOMLs so inheritance wins.
  • [medium] [violation] packages/core/src/sync/providers/edenai.ts - Check: Factored sync should not stamp provider-agnostic release_date from API created. Why: buildEdenAIModel sets release_date from model.created on the factored path, so the next bun models:sync edenai will reintroduce bad overrides whenever Eden’s timestamp differs from models/ (same failure mode as the seed files). Peers such as NanoGPT/LLM Gateway leave release_date unset for new factored rows so base metadata inherits. Action: On the factored path, omit release_date (or only preserve an already-authored provider override); keep created/today fallbacks for full inline models only.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/edenai/models/openai/o3.toml:3 - Check: reasoning_options must reflect Eden AI’s OpenAI-compatible request surface, not only that the model reasons. Why: Seed sets reasoning_options = [], but same-model peers on comparable OpenAI-compatible / chat-completions surfaces expose effort (openai/o3, openrouter/kilo/cloudflare-ai-gateway: low|medium|high). Empty is only correct if Eden was checked and does not accept a control. Action: Verify against Eden docs or a live request whether reasoning_effort / equivalent is accepted for openai/o3; if yes, author the verified effort values (with API syntax comment if non-obvious); if no, keep [] and note the negative check in the PR body.
  • [medium] [possible mistake] providers/edenai/models/openai/gpt-5.6-terra.toml:3 - Check: Same reasoning_options surface check for GPT-5.6 Terra. Why: Seed uses [], while native OpenAI and OpenRouter list effort including none|low|medium|high|xhigh|max for this model on OpenAI-style APIs. Action: Confirm Eden passthrough/rejection of effort for openai/gpt-5.6-terra and either match verified values or keep [] with explicit negative evidence.
  • [medium] [possible mistake] providers/edenai/models/moonshot/kimi-k3.toml:3 - Check: Reasoning controls for Kimi K3 on an OpenAI-compatible gateway. Why: Seed uses [], but OpenRouter (effort low|high|max) and LLM Gateway (broader effort enum) document caller controls for the same underlying model on compatible surfaces; native Moonshot also exposes toggle/effort. Action: Verify what Eden accepts for moonshot/kimi-k3 and update reasoning_options (or document why none apply).
  • [low] [possible mistake] providers/edenai/models/xai/grok-4.5.toml:3 - Check: Reasoning controls for Grok 4.5. Why: Seed uses [] while native xAI authors effort low|medium|high for xai/grok-4.5. Action: Confirm whether Eden forwards xAI/OpenAI-style effort for this ID; set verified options or keep [] with a short negative note.
  • [low] [violation] packages/core/src/sync/providers/edenai.ts:387 - Check: Sync must not drop provider-authored reasoning_options when Eden only reports supports_reasoning. Why: Factored path sets reasoning_options = existing?.reasoning_options ?? [] whenever Eden reports reasoning, so a first-time sync of a new reasoning model always writes [], and later runs only preserve what is already on disk—never discovering OpenAI-compatible effort that peers expose. That bakes unverified empties into the automated catalog. Action: Keep [] only as the unverified default, but document in the module/PR that effort/budget must be hand-audited for OpenAI-compatible routes (or detect/preserve richer options once verified), and avoid treating Eden’s boolean as proof that no control exists.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] packages/core/src/sync/providers/edenai.ts:17 - Check: reasoning_options must reflect Eden AI’s verified request surface; use [] when no caller control is verified (AGENTS.md + audit-reasoning-options). Why: edenDefaultReasoningOptions() stamps one full effort enum (none/minimal/low/medium/high/xhigh/max) on every reasoning model. The PR body itself says Eden does not expose a control surface and should default to []. That default will also be applied on the first automated full-catalog sync. Same-surface peers do not use this universal enum (e.g. OpenRouter/Cloudflare AI Gateway o3low|medium|high; OpenRouter MiniMax-M3 → []; OpenRouter Gemini 2.5 → budget_tokens/toggle, not this effort set). Action: Default new reasoning models to reasoning_options = [] unless Eden-specific evidence (docs, OpenAPI, or reproduced requests with negative controls) verifies each control and value. Do not copy the schema enum or peer values mechanically.
  • [high] [violation] providers/edenai/models/openai/o3.toml:4 - Check: Seed reasoning models must not claim unverified effort values. Why: All seed reasoning entries (Anthropic Claude Haiku/Opus/Sonnet, DeepSeek V4 Flash/Pro, Gemini 2.5 Flash/Pro, MiniMax-M3, Kimi K3, GPT-5.6 Terra, o3, Grok 4.5) share the same fabricated effort list. That contradicts AGENTS.md and peer OpenAI-compatible catalog entries for the same models. Action: Replace those blocks with reasoning_options = [], or supply Eden-specific evidence and model-accurate options (not one global enum) before merge.

@YacineMK
YacineMK force-pushed the feat/edenai-provider branch from 38c8496 to 40cfbfe Compare August 4, 2026 01:40
@YacineMK

YacineMK commented Aug 4, 2026

Copy link
Copy Markdown
Author

hi @rekram1-node I was following the same pattern as Hyper #3352 and Kilo #2997 which I mentioned before, because ci fail when u have more than 300 files But fair point I've added a curated seed of flagship models. The full catalog will follow through the automated sync

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/edenai/models/openai/o3.toml:3 - Check: Relay reasoning_options must follow lab + same-surface peers; [] means verified no caller control, not uncertainty. Why: Every reasoning seed sets reasoning_options = [] while lab/OpenRouter peers expose real controls (e.g. o3 → effort low|medium|high; gpt-5.6-terranone|low|medium|high|xhigh|max; DeepSeek V4 → toggle + high|max / peer effort; Claude Sonnet/Opus → graded effort; Gemini 2.5 → toggle + budget_tokens; Kimi K3 → effort low|high|max; Grok 4.5 → effort low|medium|high). That misreports Eden’s API surface. Action: Replace [] on all reasoner seeds (anthropic/*, deepseek/*, google/*, moonshot/kimi-k3, openai/gpt-5.6-terra, openai/o3, xai/grok-4.5, and MiniMax only if peers/docs show a control) with the peer/lab option set; add top-of-file wire comments for any toggle.
  • [high] [violation] packages/core/src/sync/providers/edenai.ts:304 - Check: Aggregator sync must not invent empty reasoning_options when controls are unknown. Why: Factored and inline paths do existing?.reasoning_options ?? [] whenever reasoning is true. Future bun models:sync edenai will re-seed [] for every reasoner and wipe correct options unless they were already hand-authored. Action: Stop defaulting to []. Preserve authored options; when missing, leave unset for runner/existing handling only after deriving from known base_model/peer controls, or skip auto-creating reasoners until options are curated.
  • [medium] [possible mistake] providers/edenai/models/moonshot/kimi-k3.toml:10 - Check: Provider modality overrides must be real host deltas, not incomplete API snapshots. Why: Seed forces input = ["text", "image"] while models/moonshotai/kimi-k3 includes video. Sync always writes Eden modalities/attachment on the factored path, so noisy API modality lists can permanently drop lab modalities. Action: Confirm Eden’s served modalities for each override (kimi-k3 video; mistral-large pdf; etc.). If Eden is incomplete, omit modalities on factored sync (cost/context only, like LLM Gateway) and drop unverified seed modality blocks.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/edenai/models/openai/gpt-5.6-terra.toml:3 - Check: Relay reasoning_options must match lab/same-surface peers; [] means verified no caller control, not uncertainty (AGENTS.md Reasoning options). Why: Eden AI is a multi-model OpenAI-compatible aggregator. Seed reasoners set reasoning_options = [] while lab/peers expose real controls (e.g. OpenAI/OpenRouter GPT-5.6 Terra: effort none|low|medium|high|xhigh|max; o3: low|medium|high; DeepSeek V4: toggle + high|max; Claude Opus 4.7: effort low|medium|high|xhigh|max; Gemini 2.5: toggle + budget_tokens; Kimi K3 / Grok 4.5 / MiniMax-M3 also non-empty). Same empty list appears on anthropic/claude-haiku-4-5, claude-opus-4-7, claude-sonnet-4-6, deepseek/deepseek-v4-{flash,pro}, google/gemini-2.5-{flash,pro}, minimax/MiniMax-M3, moonshot/kimi-k3, openai/o3, xai/grok-4.5. Action: Replace [] with host-appropriate options copied from first-party + established OpenAI-compat peers (OpenRouter/Kilo/lab), add toggle wire comments when using toggle, and only keep [] when Eden docs/API affirm no control.
  • [high] [violation] packages/core/src/sync/providers/edenai.ts:298 - Check: Automated sync must not invent empty reasoning_options for reasoners on a multi-model relay. Why: After the latest patch, new/factored reasoners omit reasoning_options; the shared runner then defaults them to [] via preserveReasoningOptions. The PR design also states capability/reasoning-control fields default to [] when Eden is silent. First full bun models:sync edenai (~800 models) will therefore mass-author empty options for controlled reasoners, which AGENTS forbids on relays. Action: When base_model resolves (or lab peers are known), author/copy that model’s control set instead of relying on the empty default; preserve hand-authored non-empty options; do not treat API silence as “no control.”

@YacineMK

YacineMK commented Aug 4, 2026

Copy link
Copy Markdown
Author

@rekram1-node Eden's api only reports supports_reasoning: true/false no per-model control detail so [] is the correct default per AGENTS.md Sync now preserves hand-authored options so individual seeds can be upgraded in follow-up PRs (same pattern as LLM Gateway)

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.

3 participants