Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef80d4df4e | ||
|
|
af0ef00109 |
No files matched your search
@@ -23,10 +23,6 @@ jobs:
|
||||
title: "chore(sync): update aggregator model catalogs"
|
||||
branch: automation/sync-models-aggregators
|
||||
labels: automation,model-sync,sync-group:aggregators,provider:openrouter
|
||||
- group: cloudflare
|
||||
title: "chore(sync): update cloudflare model catalogs"
|
||||
branch: automation/sync-models-cloudflare
|
||||
labels: automation,model-sync,sync-group:cloudflare,provider:cloudflare-workers-ai
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -46,8 +42,6 @@ jobs:
|
||||
run: bun models:sync ${{ matrix.group }}
|
||||
env:
|
||||
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
||||
CLOUDFLARE_WORKERS_AI_SYNC_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_WORKERS_AI_SYNC_ACCOUNT_ID }}
|
||||
CLOUDFLARE_WORKERS_AI_SYNC_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_AI_SYNC_API_TOKEN }}
|
||||
|
||||
- name: Validate models
|
||||
run: bun validate
|
||||
|
||||
@@ -48,12 +48,10 @@ export const cloudflareWorkersAi = {
|
||||
name: "Cloudflare Workers AI",
|
||||
modelsDir: "providers/cloudflare-workers-ai/models",
|
||||
async fetchModels() {
|
||||
const accountID = process.env.CLOUDFLARE_WORKERS_AI_SYNC_ACCOUNT_ID;
|
||||
const token = process.env.CLOUDFLARE_WORKERS_AI_SYNC_API_TOKEN;
|
||||
const accountID = process.env.CLOUDFLARE_ACCOUNT_ID;
|
||||
const token = process.env.CLOUDFLARE_API_TOKEN ?? process.env.CLOUDFLARE_API_KEY;
|
||||
if (accountID === undefined || token === undefined) {
|
||||
throw new Error(
|
||||
"Cloudflare Workers AI sync requires CLOUDFLARE_WORKERS_AI_SYNC_ACCOUNT_ID and CLOUDFLARE_WORKERS_AI_SYNC_API_TOKEN",
|
||||
);
|
||||
throw new Error("Cloudflare Workers AI sync requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN");
|
||||
}
|
||||
|
||||
const first = await fetchPage(accountID, token, 1);
|
||||
|
||||
@@ -128,6 +128,7 @@ function modalities(values: string[] | undefined, fallback: Modality[]) {
|
||||
const result = (values ?? [])
|
||||
.map((value) => value.toLowerCase())
|
||||
.filter((value): value is Modality => allowed.has(value as Modality));
|
||||
if (result.includes("image")) result.push("pdf");
|
||||
return [...new Set(result.length > 0 ? result : fallback)];
|
||||
}
|
||||
|
||||
|
||||
@@ -24,5 +24,5 @@ context = 2_000_000
|
||||
output = 30_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
input = ["text", "image", "pdf"]
|
||||
output = ["text"]
|
||||
@@ -24,5 +24,5 @@ context = 2_000_000
|
||||
output = 30_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
input = ["text", "image", "pdf"]
|
||||
output = ["text"]
|
||||
@@ -24,5 +24,5 @@ context = 2_000_000
|
||||
output = 30_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
input = ["text", "image", "pdf"]
|
||||
output = ["text"]
|
||||
@@ -24,5 +24,5 @@ context = 1_000_000
|
||||
output = 30_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
input = ["text", "image", "pdf"]
|
||||
output = ["text"]
|
||||
@@ -19,5 +19,5 @@ context = 256_000
|
||||
output = 256_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
input = ["text", "image", "pdf"]
|
||||
output = ["text"]
|
||||
@@ -117,9 +117,8 @@ OpenRouter is implemented in `packages/core/script/sync/openrouter.ts`.
|
||||
|
||||
Cloudflare Workers AI is implemented in `packages/core/script/sync/cloudflare-workers-ai.ts`.
|
||||
|
||||
- Source endpoint: `https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_WORKERS_AI_SYNC_ACCOUNT_ID/ai/models/search?format=openrouter`.
|
||||
- Required auth: `CLOUDFLARE_WORKERS_AI_SYNC_ACCOUNT_ID` and `CLOUDFLARE_WORKERS_AI_SYNC_API_TOKEN`.
|
||||
- Use a dedicated token scoped to Workers AI read access so sync automation does not share deploy credentials.
|
||||
- Source endpoint: `https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/models/search?format=openrouter`.
|
||||
- Required auth: `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` (or `CLOUDFLARE_API_KEY`).
|
||||
- The endpoint is parsed as Cloudflare's OpenRouter-like Workers AI metadata.
|
||||
- Model IDs map directly to TOML paths under `providers/cloudflare-workers-ai/models`.
|
||||
- This sync target does not manage `providers/cloudflare-ai-gateway`, because the AI Gateway `/compat/models` endpoint does not support `format=openrouter` and does not provide enough model metadata for authoritative catalog sync.
|
||||
|
||||
Reference in new issue
Block a user