Add sference provider with public /v1/models sync#3332
Conversation
sference is a managed inference platform for open-weight models, run in Europe behind an OpenAI-compatible API. This adds it as a provider with a sync module that reads the public GET /v1/models endpoint (auth-optional, no secret required) for pricing, context limits, and capabilities. Provider: - providers/sference/provider.toml — @ai-sdk/openai-compatible, base URL https://api.sference.com/v1; reasoning control (enable_thinking toggle) documented in the header comment. - providers/sference/logo.svg — the sference mark, currentColor, square viewBox. Models (sync-generated, factored onto base_model metadata): - zai-org/GLM-5.2 -> base_model zhipuai/glm-5.2 - Qwen/Qwen3.6-35B-A3B -> base_model alibaba/qwen3.6-35b-a3b - deepseek-ai/DeepSeek-V4-Flash -> base_model deepseek/deepseek-v4-flash - bottlecapai/ThinkingCap-Qwen3.6-27B -> base_model bottlecapai/... (new models/bottlecapai/thinkingcap-qwen3.6-27b.toml metadata entry, since ThinkingCap had no existing provider-agnostic metadata) All four reason via sference's enable_thinking = true|false toggle, so each declares [[reasoning_options]] type = "toggle" and an interleaved reasoning_content block. Sync module (packages/core/src/sync/providers/sference.ts) follows the chutes/venice factoring pattern: resolves base_model from the model ID, writes only API-authoritative overrides, and leaves fields the API omits (input limit, full modality arrays, knowledge) to inherit from base metadata. Reads the nested pricing object (already per-1M-token USD, no conversion) and capabilities. Registered in the direct sync group; the hourly CI job needs no SFERENCE_API_KEY since the catalog is public. The module also reads max_output_tokens and released when present. Those fields are not deployed on /v1/models yet (sference-platform commits d886540/232541a); until they ship, limit.output and release_date inherit from base metadata, and the sync is idempotent today. Once deployed, the sync will write authoritative output limits (e.g. 81_920 for the Qwen3.6 family, which differs from the base's 65_536) and real release dates. Sources: - https://sference.com/ (serverless pricing table) - https://sference.com/docs/models - https://sference.com/docs/quickstart - sference-platform commit e140c07 (public auth-optional /v1/models) Tests: packages/core/test/sference-sync*.test.ts (9 passing).
|
After reading the pull request metadata, diff, AGENTS.md, README.md, sync.md, the reasoning-options audit guide, schema code, and nearby base-revision files, I have completed my review. No actionable findings. |
| const ORG_TO_MODEL_PROVIDER: Record<string, string | undefined> = { | ||
| Qwen: "alibaba", | ||
| "zai-org": "zhipuai", | ||
| thinkingmachines: "thinkingmachines", | ||
| bottlecapai: "bottlecapai", | ||
| moonshotai: "moonshotai", | ||
| MiniMaxAI: "minimax", | ||
| "deepseek-ai": "deepseek", | ||
| google: "google", | ||
| "meta-llama": "meta", | ||
| nvidia: "nvidia", | ||
| openai: "openai", | ||
| }; |
There was a problem hiding this comment.
whats the point of having mappings if they are openai -> openai? Any mapping thatt is already an exact match should be removed from this, the assumption should be that if there isnt a custom mapper then the provider name is the org name
| [[reasoning_options]] | ||
| type = "toggle" |
| [[reasoning_options]] | ||
| type = "toggle" |
| [[reasoning_options]] | ||
| type = "toggle" |
There was a problem hiding this comment.
r u sure?
No reasoning effort?
| [[reasoning_options]] | ||
| type = "toggle" |
- Remove identity org mappings (openai->openai etc.) from ORG_TO_MODEL_PROVIDER; fall back to the org name itself so unmapped orgs still resolve to base_model metadata. - DeepSeek V4 Flash's worker accepts reasoning_effort = high|max (xhigh->max) in addition to enable_thinking, but the public /v1/models catalog only exposes the toggle. Since the API is not authoritative for the reasoning control surface, the sync now preserves hand-authored reasoning_options instead of overwriting them, and DeepSeek V4 Flash declares both a toggle and an effort option (matching ambient). - Add a test for reasoning_options preservation. - Pick up updated DeepSeek V4 Flash pricing from the live endpoint ($0.08/$0.20 -> $0.14/$0.28, cache $0.02 -> $0.03).
…king The worker's reasoning_effort handling is unreachable from the public API: chat ingress validates with extra="ignore" and builds the worker body from an allowlist, and /v1/responses only forwards enable_thinking. All sference reasoning models are toggle-only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Hey @rekram1-node, thanks for the review. |
|
Based on my thorough review of the diff, base-revision files, schema, sync infrastructure, and documentation, I've identified the following: Action items
|
What
Adds sference — a managed inference platform for open-weight models, run in Europe behind an OpenAI-compatible API — as a provider.
Why
sference serves open-weight checkpoints (GLM, Qwen, DeepSeek, ThinkingCap) with per-token pricing and a public model catalog. There was no entry for it in models.dev.
Changes
Provider (
providers/sference/):provider.toml—@ai-sdk/openai-compatible, base URLhttps://api.sference.com/v1. Reasoning control (enable_thinking = true|falsetoggle) documented in the header comment.logo.svg— the sference mark,currentColor, square0 0 32 32viewBox.Models (sync-generated, factored onto
base_modelmetadata — no duplicated provider-agnostic facts):zai-org/GLM-5.2zhipuai/glm-5.2Qwen/Qwen3.6-35B-A3Balibaba/qwen3.6-35b-a3bdeepseek-ai/DeepSeek-V4-Flashdeepseek/deepseek-v4-flashbottlecapai/ThinkingCap-Qwen3.6-27Bbottlecapai/thinkingcap-qwen3.6-27bAll four reason via sference's
enable_thinking = true|falsetoggle, so each declares[[reasoning_options]] type = "toggle"and an interleavedreasoning_contentblock.New model metadata (
models/bottlecapai/thinkingcap-qwen3.6-27b.toml) — ThinkingCap had no existing provider-agnosticmodels/entry, so one was added (open-weight Qwen3.6-27B fine-tune, cited to HuggingFace + bottlecapai.com).Sync module (
packages/core/src/sync/providers/sference.ts):GET /v1/modelsendpoint (auth-optional, noSFERENCE_API_KEYsecret required) for pricing, context limits, and capabilities.base_modelfrom the model ID, writes only API-authoritative overrides, and leaves fields the API omits (input limit, full modality arrays, knowledge) to inherit from base metadata.pricingobject), so no token→1M conversion is needed.directsync group; the hourly CI job needs no secret since the catalog is public.max_output_tokensandreleasedwhen present (see below).Tests (
packages/core/test/sference-sync*.test.ts): 9 passing — unit tests for the translate/factoring logic plus an end-to-end test that runs the full sync runner against a mocked public endpoint and verifies idempotency.How it stays updated
The hourly
sync-models.ymlworkflow auto-discovers providers registered inpackages/core/src/sync/index.ts, so registering sference there schedules a job that syncs the public catalog into anautomation/sync-models-sferencebranch and opens/updates a PR whenever pricing, models, or limits change. No workflow edits were needed (no new secrets).Note on
max_output_tokens/releasedThe sync module already reads
max_output_tokens(→limit.output) andreleased(→release_date) from the API. Those fields are implemented on the sference platform side (commits d886540 and 232541a) but not yet deployed toapi.sference.com. Until they ship,limit.outputandrelease_dateinherit from base metadata, and the sync is idempotent today (verified against the live endpoint). Once deployed, the next hourly sync will write authoritative output limits (e.g.81_920for the Qwen3.6 family, which differs from the base's65_536) and real release dates — no further models.dev changes needed.Sources
/v1/modelswith per-1M-token USD pricing)Verification
bun validate— sference validates with 4 modelsbun test— 9/9 sference tests passtsc --noEmit— cleanbun models:sync sference --dry-run— idempotent (0 changes) against the live public endpoint