Skip to content

feat(ambient): sync model catalog from API - #2692

Closed
ambient-gregory wants to merge 1 commit into
anomalyco:devfrom
ambient-gregory:ambient-model-sync
Closed

feat(ambient): sync model catalog from API#2692
ambient-gregory wants to merge 1 commit into
anomalyco:devfrom
ambient-gregory:ambient-model-sync

Conversation

@ambient-gregory

@ambient-gregory ambient-gregory commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Ambient now syncs from /v1/models in the hourly workflow instead of a hand-maintained allowlist. Replaces the ambient:generate script with a SyncProvider and picks up the full model list (15 models).

Ambient's API reports an openrouter.slug, per-token pricing, and supported_features, so each model is adapted to the OpenRouter shape and run through buildOpenRouterModel (same as cloudflare-workers-ai). Models with a canonical definition inherit it via base_model and override only cost, limit, and modalities; the two gpt-oss models have no canonical entry and are emitted in full.

Models

Model base_model Input $/M Output $/M
zai-org/GLM-5.1-FP8 zhipuai/glm-5.1 1.40 4.40
ambient/large zhipuai/glm-5.1 1.40 4.40
z-ai/glm-4.5-air zhipuai/glm-4.5-air 0.125 0.85
moonshotai/kimi-k2.6 moonshotai/kimi-k2.6 0.67 3.39
moonshotai/kimi-k2.7-code moonshotai/kimi-k2.7-code 0.75 3.50
google/gemma-4-26b-a4b-it google/gemma-4-26b-a4b-it 0.10 0.30
google/gemma-4-31b-it google/gemma-4-31b-it 0.20 0.80
nvidia/nemotron-3-nano-30b-a3b nvidia/nemotron-3-nano-30b-a3b 0.05 0.20
qwen/qwen3-coder-30b-a3b-instruct alibaba/qwen3-coder-30b-a3b-instruct 0.07 0.27
qwen/qwen3-next-80b-a3b-instruct alibaba/qwen3-next-80b-a3b-instruct 0.09 1.10
qwen/qwen3.5-35b-a3b alibaba/qwen3.5-35b-a3b 0.14 1.00
qwen/qwen3.6-27b alibaba/qwen3.6-27b 0.32 3.20
qwen/qwen3.6-35b-a3b alibaba/qwen3.6-35b-a3b 0.15 1.00
openai/gpt-oss-120b 0.15 0.60
openai/gpt-oss-20b 0.029 0.14

@ambient-gregory
ambient-gregory marked this pull request as ready for review June 19, 2026 16:37
@ambient-gregory

Copy link
Copy Markdown
Contributor Author

Hi @rekram1-node, would love to get this reviewed 🙏

@rekram1-node

Copy link
Copy Markdown
Collaborator

AUTOMATED REVIEW: Blocking merge: generated reasoning models lack explicit provider options, transient API omissions can delete local files, and the sync ignores source is_ready state while most returned models are not ready. Add conservative deletion/readiness handling, options or [], regenerate, and resolve conflicts.

@ambient-gregory
ambient-gregory force-pushed the ambient-model-sync branch 2 times, most recently from 2b091b8 to 45c47b2 Compare June 29, 2026 10:44
@ambient-gregory

Copy link
Copy Markdown
Contributor Author

Thank you for the review @rekram1-node, this is ready for a final look 🙏

Add an Ambient sync provider that maps the OpenRouter-shaped catalog through the
shared builder. Skip catalog entries with is_ready=false so only served models
are generated, and set deleteMissing=false with skipped/missing notices so a
transient catalog omission retains local files instead of deleting them. Emit
reasoning_options = [] for reasoning models, since Ambient exposes no reasoning
control, rather than silently inheriting the base model's options.
@ambient-gregory

Copy link
Copy Markdown
Contributor Author

@rekram1-node just following up here, thank you 🙏

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [violation] providers/ambient/models/zai-org/GLM-5.2-FP8.toml:1 and sync completeness — Check: Sync idempotence and full-output commit (sync.md steps 8–10). Why: The PR body lists 15 synced models, but the diff only creates 1 new model file (zai-org/GLM-5.2-FP8.toml) and modifies 1 (moonshotai/kimi-k2.7-code.toml); the remaining ~13 models (e.g., ambient/large, openai/gpt-oss-120b, qwen/qwen3-coder-30b-a3b-instruct) are absent from providers/ambient/models/. The one new file that is committed does not match what bun models:sync ambient would produce: buildOpenRouterModelfactorBaseModel generates a description via describeModel (e.g., "Flagship GLM model for hybrid reasoning, coding, and agentic engineering") that differs from the base model's hand-authored description, so the sync would write it as an override, but the committed file omits it. The next CI sync run would both create the missing models and rewrite this file, violating the clean dry-run expectation. The PR body also contradicts the diff — it lists zai-org/GLM-5.1-FP8 and kimi prices 0.75/3.50, while the diff creates GLM-5.2-FP8 and sets kimi to 0.84/3.99. Action: Run bun models:sync ambient, commit the full generated output, then run bun models:sync ambient --dry-run and bun validate; reconcile the PR body with the actual diff.

  • [low] [possible mistake] providers/ambient/models/zai-org/GLM-5.2-FP8.toml:1Check: Provider-specific interleaved field. Why: The sibling providers/ambient/models/zai-org/GLM-5.1-FP8.toml:7 declares [interleaved] field = "reasoning_content" for Ambient's GLM-5.1 serving. GLM-5.2 is also a reasoning model from the same family, but the new file omits [interleaved]. The sync code sets interleaved: existing?.interleaved (undefined for new files), so it would not add this field automatically. Action: Verify whether Ambient's GLM-5.2-FP8 returns interleaved reasoning in reasoning_content and add [interleaved] if so.

  • [low] [possible mistake] Pricing data in moonshotai/kimi-k2.7-code.toml:5-6 and zai-org/GLM-5.2-FP8.toml:5-7Check: Source citations for material pricing changes. Why: The diff updates kimi-k2.7-code prices (0.75→0.84 input, 3.5→3.99 output) and introduces GLM-5.2-FP8 prices (1.2/4.2, cache_read 0.26, limit.output 202_752). The PR body references the /v1/models endpoint but does not link to it or to Ambient's pricing documentation, so the values cannot be reviewed against evidence. Action: Add a direct citation to Ambient's /v1/models endpoint or pricing page stating what each cited value supports.

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.

2 participants