Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/llm-info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you want to add a new LLM model or provider, you can do so by editing the YAM

## Syncing from `models.dev`

`pnpm sync-models` appends latest models from [`models.dev`](https://models.dev/api.json) to `models.yml`. Existing entries are preserved. Run `pnpm codegen` afterwards.
`pnpm sync-models` adds the latest models from [`models.dev`](https://models.dev/api.json) to the top of each provider section in `models.yml`. Existing entries are preserved. Run `pnpm codegen` afterwards.

```bash
pnpm sync-models # all providers, 10 newest each
Expand Down
33 changes: 33 additions & 0 deletions packages/llm-info/data/models.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
anthropic:

- name: Claude Opus 4.8
model: claude-opus-4-8
description: "Modest but tangible improvement over Claude Opus 4.7"
roles: [chat, edit]
capabilities: [thinking, tool_calling]
input_types: [text, image, pdf]
output_types: [text]
release_date: 2026-05-28
cost: {input: 5, output: 25}

- name: Claude Opus 4.7
model: claude-opus-4-7
description: "Next generation of Anthropic's Opus family, built for long-running, asynchronous agents"
Expand Down Expand Up @@ -199,6 +210,17 @@ google:
cost: {input: 2, output: 12}

bedrock:

- name: Claude Opus 4.8 (Global)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Missing non-global variant for Claude Opus 4.8 in bedrock. Opus 4.7 has both anthropic.claude-opus-4-7 and global.anthropic.claude-opus-4-7. Only the global variant was added for Opus 4.8. If the non-global variant is also available, add it.

Prompt for AI agents
Check if this issue is valid β€” if so, understand the root cause and fix it. At packages/llm-info/data/models.yml, line 214:

<comment>Missing non-global variant for Claude Opus 4.8 in bedrock. Opus 4.7 has both `anthropic.claude-opus-4-7` and `global.anthropic.claude-opus-4-7`. Only the global variant was added for Opus 4.8. If the non-global variant is also available, add it.</comment>

<file context>
@@ -199,6 +210,17 @@ google:
 
 bedrock:
+
+  - name: Claude Opus 4.8 (Global)
+    model: global.anthropic.claude-opus-4-8
+    description: "Modest but tangible improvement over Claude Opus 4.7"
</file context>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't add it for now. Could see if users want that too. The global variant is the most available for all regions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contextβ€”understood.

model: global.anthropic.claude-opus-4-8
description: "Modest but tangible improvement over Claude Opus 4.7"
roles: [chat, edit]
capabilities: [thinking, tool_calling]
input_types: [text, image, pdf]
output_types: [text]
release_date: 2026-05-28
cost: {input: 5, output: 25}

- name: Claude Opus 4.7
model: anthropic.claude-opus-4-7
description: "Next generation of Anthropic's Opus family, built for long-running, asynchronous agents"
Expand Down Expand Up @@ -654,6 +676,17 @@ wandb:
cost: {input: 0.1, output: 0.1}

opencode-go:

- name: Qwen3.7 Max
model: qwen3.7-max
description: "Capable of writing and debugging code, and sustaining autonomous execution across hundreds or thousands of steps"
roles: [chat, edit]
capabilities: [thinking, tool_calling]
input_types: [text]
output_types: [text]
release_date: 2026-05-21
cost: {input: 2.5, output: 7.5}

- name: DeepSeek V4 Flash
model: deepseek-v4-flash
description: "Efficiency-optimized Mixture-of-Experts model from DeepSeek with 284B total parameters and 13B activated parameters, supporting a 1M-token context window"
Expand Down
6 changes: 5 additions & 1 deletion packages/llm-info/src/__tests__/sync-models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ describe("syncModels", () => {
writeFileSync(yamlPath, FIXTURE_YAML);
});

it("appends new entries to existing provider sections and creates new ones", async () => {
it("prepends new entries to existing provider sections and creates new ones", async () => {
const result = await syncModels({
modelsYamlPath: yamlPath,
modelsDev: FIXTURE_API,
Expand Down Expand Up @@ -664,6 +664,10 @@ describe("syncModels", () => {
);
expect(opus45.description).toBe("A hand-written description.");
expect(opus45.name).toBe("Claude Opus 4.5");
expect(parsed.anthropic.map((m: { model: string }) => m.model)).toEqual([
"claude-opus-4-7",
"claude-opus-4-5",
]);
});

it("renders flow-style arrays and a blank line between entries", async () => {
Expand Down
21 changes: 14 additions & 7 deletions packages/llm-info/src/sync-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface SyncOptions {
modelsDev?: ModelsDevApi;
write?: boolean;
mode?: SyncMode;
/** Cap on new entries appended per provider section. */
/** Cap on new entries inserted per provider section. */
maxPerProvider?: number;
/** Restrict sync to these marimo provider ids (defaults to all). */
providers?: readonly string[];
Expand Down Expand Up @@ -170,10 +170,10 @@ function renderFresh(entries: ModelsByProvider): string {
}

/**
* Append new entries into an existing document, creating provider sections if
* Insert new entries into an existing document, creating provider sections if
* needed. Preserves comments and ordering of unchanged sections.
*/
function appendIntoDocument(
function insertIntoDocument(
yamlText: string,
newEntries: ModelsByProvider,
): string {
Expand All @@ -199,13 +199,20 @@ function appendIntoDocument(
// New section appended after existing content β€” always blank-line separated.
addProviderSection(doc, root, provider, seq, true);
}
for (const model of models) {
const originalFirstItem = seq.items[0] as { spaceBefore?: boolean };
const newItems: YAMLMap[] = [];
for (const [index, model] of models.entries()) {
const item = buildEntryNode(doc, model);
if (seq.items.length > 0) {
if (index > 0 || originalFirstItem?.spaceBefore) {
(item as { spaceBefore?: boolean }).spaceBefore = true;
}
seq.items.push(item);
newItems.push(item);
}
if (newItems.length > 0 && seq.items.length > 0) {
// Preserve a blank line between the prepended block and curated entries.
originalFirstItem.spaceBefore = true;
}
seq.items.unshift(...newItems);
}

return doc.toString({ lineWidth: 0, flowCollectionPadding: false });
Expand Down Expand Up @@ -253,7 +260,7 @@ export async function syncModels(options: SyncOptions): Promise<SyncResult> {
const yaml = isFresh
? renderFresh(summary.newEntries)
: addedCount > 0
? appendIntoDocument(existingText, summary.newEntries)
? insertIntoDocument(existingText, summary.newEntries)
Comment thread
Light2Dark marked this conversation as resolved.
Comment thread
Light2Dark marked this conversation as resolved.
: existingText;

if (write && (addedCount > 0 || mode === "replace")) {
Expand Down
Loading