Skip to content

feat(providers): support common providers from models.dev #860

Closed

Description

@Astro-Han

Problem

Maka hand-maintains provider and model facts across core, runtime, Desktop, CLI, and headless. Adding a provider requires changing parallel lists, which creates inconsistent behavior and makes provider support difficult to verify.

LiteLLM would add a routing dependency without fixing ownership.

Direction

Vendor a versioned models.dev snapshot and update it deterministically during releases or major upstream changes. Do not fetch models.dev at runtime or add models.dev/LiteLLM as runtime dependencies.

Expose one provider registry composed from:

  1. models.dev provider and model facts;
  2. Maka's shared runtime adapters;
  3. minimal provider overrides for authentication, headers, endpoints, discovery, or request differences.

Provider /models responses are authoritative for account-specific availability. The checked-in snapshot is the fallback. Exact model ids must never be rewritten.

Azure, Bedrock, and Vertex remain out of scope because IAM, project, and region configuration require separate product work. LiteLLM remains available through the generic openai-compatible connection, but Maka does not ship a dedicated LiteLLM preset or introduce LiteLLM as a routing layer.

Invariants

Every provider checkbox below represents a complete product slice:

  • one stable persisted provider id;
  • registry-owned defaults, catalog placement, and runtime/discovery behavior;
  • credential configuration across relevant Desktop, CLI, and headless paths;
  • account-specific model discovery where supported, with snapshot fallback;
  • exact model-id preservation;
  • model selection and an agent tool-call run;
  • deterministic tests without secrets or raw provider responses;
  • a sanitized live smoke before support is marked complete.

Provider-specific behavior belongs only in the registry adapter/override layer.

Contributor guardrails

Before starting a slice, check the latest issue comments and open PRs. Do not duplicate an actively claimed provider; post or update a claim so parallel work can move to an unclaimed checklist item.

Brand assets are a merge gate:

  • Use a real, existing provider SVG from an official brand package or a trusted open-source source such as Lobe Icons. If Lobe Icons has no suitable mark, use the provider's official download or another established open-source repository.
  • Record the source repository, released package version and/or immutable commit, exact upstream path, license, and full SHA-256. Vendor the SVG byte-for-byte. Never hand-draw, trace, AI-generate, convert a raster image to SVG, or silently rewrite the upstream SVG to make it render.
  • Reuse the shared provider-logo path for catalog, detail, and first-run surfaces. Extend the packaged third-party notice inventory and keep a deterministic build check proving the notice survives into the renderer distribution; do not create another notice or header mechanism.
  • An external SVG loaded through <img> does not inherit the parent's currentColor. Preserve upstream bytes and use the existing theme-aware CSS mask/currentColor seam for monochrome marks. Verify the computed mask and color in the rendered catalog and detail states; DOM visibility alone is insufficient.

Implementation guardrails:

  • “OpenAI-compatible” does not prove identical authentication, discovery, request, or tool-call behavior. Confirm official documentation and exercise a deterministic two-stage loop: provider requests a tool, Maka executes it and returns the tool result, then the provider returns the final assistant response.
  • A no-auth provider must omit Authorization; do not inject a dummy API key. Keep exact model IDs unchanged through discovery, persistence, selection, both tool-call turns, and fallback.
  • Direct API, Coding Plan, Token Plan, and Agent Plan access paths from the same vendor remain separate persisted provider ids whenever endpoint, key, billing, model allowlist, or permitted use differs. Many subscription plans permit only interactive coding/agent tools; deterministic tests must stay fake, and any live smoke must use Maka interactively with a user-owned key.
  • Start each flat PR from the latest main. Give shared files and seams one owner, then rebase dependent slices instead of implementing parallel versions.
  • Local Desktop E2E may be deferred to CI; the CI E2E job remains a merge gate. When a local E2E run is needed for diagnosis or visual evidence, use one worker. Treat Electron/fixture startup timeouts as infrastructure only after log evidence and a clean serial rerun; do not change production code to mask a resource flake.

PR sizing

The checklist describes independently verifiable product slices, not mandatory one-PR phases.

Default to one provider or plan variant per PR. A small cohort may share one PR only when every member:

  • uses the exact same runtime adapter;
  • uses the same authentication and discovery behavior;
  • requires no provider-specific override;
  • can be tested and reverted as one unit.

Do not split a provider vertically into separate registry, runtime, UI, and test PRs. Each merged PR must leave the provider usable and independently revertible.

The current upper bound is 48 implementation PRs. The final number may be lower when implementation evidence proves that a small regional cohort is genuinely identical.

Delivery order

flowchart LR
  P1["Phase 1<br/>Tracer bullet"] --> P2["Phase 2<br/>Registry foundation"]
  P2 --> P3["Phase 3<br/>Hosted APIs"]
  P2 --> P4["Phase 4<br/>Model plans"]
  P2 --> P5["Phase 5<br/>Local runtimes"]
  P2 --> P6["Phase 6<br/>First run"]
  P2 --> P7["Phase 7<br/>Contract foundation"]
  P3 --> P8["Phase 8<br/>Release closeout"]
  P4 --> P8
  P5 --> P8
  P6 --> P8
  P7 --> P8
Loading

Phases 3–6 may proceed in parallel from the merged Phase 2 foundation. Phase 7 may begin once representative access paths exist for API keys, plans, aggregators, local no-auth or optional-auth runtimes, OAuth, regional endpoints, discovery and fallback, reasoning, and tool calls. Phase 7 stays additive: it may add registry- and capability-derived conformance coverage and gap reporting, but it must not remove compatibility paths or claim release completion. Phase 8 starts only after every remaining Phase 3–6 item is delivered or explicitly deferred out of the current acceptance scope.

Delivered

Existing providers retain their persisted ids and observable behavior.

Phase 3: Hosted APIs

Add the remaining direct API providers and OpenRouter.

Anthropic, OpenAI, Gemini, DeepSeek, Moonshot, MiniMax, and SiliconFlow already have registry/runtime paths. Phase 7 will include them in the final contract and smoke matrix.

Phase 4: Model plans

Kimi Coding Plan and Z.AI Coding Plan already exist and were migrated onto the shared registry path in Phase 2.

Add the remaining plan-specific variants with their own persisted ids, authentication, endpoints, and discovery behavior:

A direct API provider and its plan variant remain separate product slices even when one person implements both.

Phase 5: Local runtimes

Phase 6: First run

Do not maintain another onboarding provider list or redesign the connection-management flow.

Candidate watchlist (not part of Phase 3–6 acceptance)

These candidates remain intentionally outside the completion matrix until their lifecycle, public contract, or demand is strong enough:

  • Baidu Qianfan Coding/Token Plan personal migration, pending an authoritative current lifecycle contract;
  • Volcengine Ark Agent Plan;
  • JD Cloud Coding Plan, pending an auditable first-party endpoint contract;
  • Baseten, SambaNova Cloud, KUAE Cloud Coding Plan, CTYun Coding Token Plan, SCNet plans, PPIO, Infinigence GenStudio, and team-oriented Token Plans.

Explicit exclusions:

  • GitHub Models, which GitHub will fully retire on 2026-07-30;
  • Infini Coding Plan, which stopped service on 2026-06-26;
  • a dedicated ModelScope preset while it remains a no-SLA experimental inference service;
  • dedicated vLLM or arbitrary self-hosted deployment ids, which remain covered by openai-compatible;
  • Replicate, whose prediction contract is not Maka's agent chat/tool-call contract;
  • Baichuan and SenseNova until a current public two-stage tool-call contract exists.

Phase 7: Contract foundation

Phase 7 may begin before every Phase 3–4 provider is finished. It defines an open-world contract: provider rows may continue to be added, while shared behavior and provider-owned differences remain explicit and testable.

Do not use Phase 7 to remove compatibility paths, declare the release complete, or start Phase 8 cleanup.

Phase 8: Release closeout

Run Phase 8 only after the remaining Phase 3–6 scope is delivered or explicitly deferred out of the current acceptance matrix:

Final release gate:

  • Record a sanitized live smoke for every target provider using at least one real model Dropped by maintainer decision (2026-07-16): maintainers do not hold keys or subscriptions for the full target matrix. The CI-enforced deterministic conformance matrix is the standing quality gate; provider-specific wire issues will be fixed on user reports.

Secrets, credentials, raw provider responses, and sensitive account data must never be committed, logged, copied into fixtures, or posted to GitHub.

Acceptance

  • One deterministic command updates the checked-in models.dev snapshot (npm run sync:model-metadata)
  • Settings, Desktop, CLI, runtime, and headless consume the same registry (feat(providers): centralize provider registry #866)
  • No covered provider/model facts remain duplicated in hand-written tables (test(runtime): delete hand-written conformance replaced by the generated matrix #1108; remaining hand-written metadata expresses facts models.dev cannot)
  • Every target provider can configure credentials or no-auth access as appropriate
  • Provider model discovery is authoritative when available, with snapshot fallback
  • Exact model ids survive discovery, persistence, selection, and execution unchanged (matrix exact-model-id dimension, including edge wire samples for composite ids)
  • Every target provider completes an agent tool-call run (deterministic two-stage tool loop per matrix row; live smoke dropped per the decision above)
  • Advertised reasoning and vision capabilities work where supported (deterministic reasoning-replay dimension; live verification dropped with the smoke gate)
  • Provider-specific behavior exists only in the adapter/override layer (feat(core): derive provider conformance matrix from registry declarations #974, refactor(providers): land the three Phase 8 conformance preconditions #1105 executable override bindings)
  • Existing persisted provider ids remain compatible
  • CI contains deterministic conformance coverage for the target matrix (gap report fails CI on any uncovered ready-provider dimension)
  • The sanitized live-smoke gate is complete Dropped by maintainer decision (2026-07-16), see the release-gate note above.

Activity

  1. Colafornia commented on Jul 13, 2026

    @Colafornia
    Member

    I'm planning to take the Phase 3 API-layer work for Groq, OpenRouter, and Alibaba. Targeting 2026-07-14.

  2. zhiiw commented on Jul 13, 2026

    @zhiiw
    Contributor

    I'm planning to take the Phase 3 API-layer work for Z.AI / 智谱直连 API and xAI. Targeting 2026-07-15

  3. zhiiw commented on Jul 13, 2026

    @zhiiw
    Contributor

    I noticed xAI support has already been added in a recent PR, so I’d like to take the Phase 3 API-layer work for Xiaomi and Z.AI / 智谱直连 API instead. I'll submit a PR for it.

  4. Astro-Han commented on Jul 13, 2026

    @Astro-Han
    ContributorAuthor

    Coordination update for Issue #860 Phase 3–6

    Merged:

    Currently in progress under our local delivery goal:

    • Tencent Coding Plan (tencent-coding-plan), limited to the original Phase 4 Tencent plan family.

    Target matrix:

    • The Issue body contains the user-confirmed expanded Phase 3–6 matrix, with a theoretical upper bound of 48 implementation PRs.
    • Newly explicit targets include Ollama Cloud; Volcengine Ark and BytePlus ModelArk direct/Coding Plan access paths; Cohere; DeepInfra; Hugging Face Inference Providers; Cloudflare Workers AI; Vercel AI Gateway; Baidu Qianfan; iFlytek Spark and Astron Coding Plan; Huawei Cloud MaaS and MaaS Token Plan; complete regional Alibaba and Xiaomi plan identities, plus separate China/global StepFun direct and Step Plan identities; Tencent Coding and Token Plans; and LocalAI.
    • The local Ollama provider retains its existing persisted id and receives a separate cloud-alias validation item.
    • A candidate watchlist and explicit exclusions are recorded without making them Phase 3–6 completion requirements.
    • BytePlus remains gated on a real official SVG with sufficient usage permission.
    • Per the latest user instruction, the expanded scope is recorded only. No implementation thread was created for the new matrix items.
    • No Phase 7 work has started.

    The delivery goal remains active. Each implementation slice uses an isolated worktree and independently revertible PR, deterministic TDD coverage, an independent review, green CI before squash merge, and a real traceable upstream provider SVG with provenance and licensing. Local Desktop E2E may be deferred to CI; CI E2E remains a merge gate.

    Overlap avoidance:

    • We stopped our unpublished Groq work after seeing the existing Groq claim. No Groq branch or PR was published.
    • We will not start Groq, OpenRouter, Alibaba direct API, Xiaomi direct API, or Z.AI direct API while the current claims remain active.
    • Before scheduling every next slice, we will re-check this issue. If a new comment overlaps our queue, our scheduler will move to another unclaimed checklist item.
    • The active internal implementation claim is limited to Tencent Coding Plan (tencent-coding-plan), which belongs to the original Phase 4 Tencent plan family. Tencent Token Plan and other expanded matrix items remain unclaimed.

    We will update this comment when the active set or merge state changes.

  5. Astro-Han commented on Jul 13, 2026

    @Astro-Han
    ContributorAuthor

    Coordination update: active Phase 3–5 slices

    Newly merged:

    Currently in progress in separate local delivery threads and isolated git worktrees:

    • No provider implementation slice currently owns the publication slot. The scheduler is refreshing external claims and fact gates before assigning another slice.

    Merge queue: empty pending the overlap and fact-gate refresh.

    Scope reduction:

    • Removed Baidu Qianfan, iFlytek Spark, iFlytek Astron Coding Plan, Huawei Cloud MaaS, and Huawei Cloud MaaS Token Plan from Phase 3–4. Current demand does not justify keeping feat(providers): support common providers from models.dev #860 open without authoritative provider IDs.
    • Removed BytePlus ModelArk direct API and Coding Plan from Phase 3–4. Coding Plan has some early adoption, but we found no official SVG we can ship under the current terms. BytePlus also requires prior written consent to use its logo. Reconsider these providers in a separate issue if demand and brand permission are established.

    Overlap avoidance remains unchanged: we will not start Groq, OpenRouter, Alibaba direct API, Xiaomi direct API, or Z.AI direct API while the existing external claims remain active.

    Every slice remains independently revertible, uses deterministic two-stage tool-call coverage, a real byte-identical upstream SVG or a proven existing shared asset path, named reviewer approval with 0 P0–P3 findings, and green typecheck/test/e2e CI before squash merge. Local Desktop E2E may be deferred to CI. Phase 7 has not started.

  6. Astro-Han commented on Jul 14, 2026

    @Astro-Han
    ContributorAuthor

    I’m taking the GitHub Copilot subscription slice under the stable github-copilot provider id. This is the Copilot account/subscription service (api.githubcopilot.com), not the retiring GitHub Models inference API (models.github.ai/inference).

    Scope: reuse the existing OAuth credential lifecycle and account-connection seam; preserve account-specific endpoints and exact discovered model IDs; add deterministic device-flow/token-refresh, discovery, reasoning, and two-stage tool-call coverage; vendor a governed upstream Copilot SVG. No Phase 7 work and no credentials or raw live responses will be recorded.

  7. Astro-Han commented on Jul 14, 2026

    @Astro-Han
    ContributorAuthor

    Correction after #937 merged: #907 covered exact :cloud aliases through a signed-in local Ollama daemon and intentionally did not add a hosted provider identity. #937 adds the independent ollama-cloud direct API provider at https://ollama.com/v1, with OLLAMA_API_KEY, official model discovery plus snapshot fallback, exact model IDs, deterministic reasoning/tool-call coverage, and Desktop/CLI/Headless/storage integration. Local Ollama remains unchanged.

  8. Astro-Han commented on Jul 14, 2026

    @Astro-Han
    ContributorAuthor

    GitHub Copilot subscription support shipped in #943 (squash commit e052b2aedc14442b30c10d12ea8c206da7c7797f). This is the Copilot subscription service at api.githubcopilot.com, not the retiring GitHub Models inference API. The slice includes shared registry/catalog/account/storage/CLI/headless wiring, account-authoritative model discovery and exact protocol selection, tool/reasoning conformance, upstream Copilot branding/notice governance, a sanitized live /models smoke, green typecheck/test/e2e CI, and 0 P0–P3 final review findings.

  9. Astro-Han commented on Jul 14, 2026

    @Astro-Han
    ContributorAuthor

    Claiming Phase 7 (contract foundation). No provider slices are claimed and active Phase 3–4 claims are unaffected.

    Design: conformance becomes an interpretation of the registry declarations instead of a seventh hand-maintained list.

    • Rows: every registry entry with status === 'ready' and a usable runtime adapter, derived at test time. This is intentionally not READY_PROVIDER_TYPES, whose membership is "has readyOrder" and currently omits github-copilot.
    • Columns: contract dimensions. v1 covers model discovery, exact-model-id preservation, the two-stage tool loop, and reasoning replay; later dimensions stay additive.
    • Each (provider, dimension) cell must land in exactly one of three states: generated (expectations derived from protocol / runtimeAdapter / modelDiscovery / capability declarations, executed against scripted local HTTP servers through the existing deterministic conformance harness), overridden (a named hand-written test registered for that cell, reserved for provider-specific contracts such as the OAuth subscription flows, Cohere native pagination, and the ZenMux signed-reasoning round trip), or explicitly N/A with a machine-readable reason (fallback discovery providers instead assert that /models is never called).
    • Gap reporting needs no extra machinery: a ready provider whose applicable dimension has neither a generated cell nor a registered override fails CI, naming the provider id and the missing dimension. Future ready providers enter the matrix by declaration alone.

    Phase 7 stays additive per the issue body. Existing hand-written suites and compatibility paths remain untouched; consolidation belongs to Phase 8. Where a hard-coded branch blocks generation (for example the /^gpt-5/ Responses-routing regex, which the existing ModelInfo.apiProtocol seam can replace), the declaration lift will come as a separate follow-up PR.

  10. Astro-Han commented on Jul 14, 2026

    @Astro-Han
    ContributorAuthor

    Phase 7 claim above (#860 (comment)) is delivered — landed on main via #974 (04703d6a).

    All three Phase 7 checklist items are checked: the conformance matrix derives rows and expectations from registry declarations (future ready providers enter automatically), the gap report names any provider dimension that is neither generated, overridden, nor justified N/A, and provider-specific behavior lives in the named override layer. Additive as required: no runtime changes, no compatibility paths removed.

    Recorded Phase 8 preconditions (in #974): per-cell credential cases (or override) for optional_api_key discovery before deleting overlapping hand-written coverage; executable override bindings to replace the textual title check; apiProtocol declaration lift to retire the /^gpt-5/i routing regex.

  11. Astro-Han commented on Jul 16, 2026

    @Astro-Han
    ContributorAuthor

    Closing: every Phase 3–6 slice is delivered or explicitly moved out of scope, Phase 7 landed in #974, and Phase 8 closeout is complete.

    Final slices merged today:

    The three subscription-plan slices were implemented without maintainer-held subscriptions: no live smoke was run, coverage is fully deterministic (fallback-discovery reverse assertions plus the two-stage tool loop), and wire issues will be fixed on user reports.

    Scope decision recorded in the issue body: the "sanitized live smoke for every target provider" release gate is dropped. Maintainers do not hold keys or subscriptions for the full matrix; the CI-enforced conformance matrix (52 ready rows × 4 dimensions: 178 generated / 22 justified N/A / 8 executable overrides, 0 gaps) is the standing quality gate.

    The candidate watchlist remains available for future issues if demand materializes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions