@aeye/models 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/aeye-models.md +272 -265
  2. package/dist/scripts/codegen.d.ts +4 -0
  3. package/dist/scripts/codegen.d.ts.map +1 -1
  4. package/dist/scripts/codegen.js +11 -0
  5. package/dist/scripts/codegen.js.map +1 -1
  6. package/dist/scripts/scrape.d.ts +2 -1
  7. package/dist/scripts/scrape.d.ts.map +1 -1
  8. package/dist/scripts/scrape.js +8 -4
  9. package/dist/scripts/scrape.js.map +1 -1
  10. package/dist/scripts/scrapers/aws.d.ts +5 -1
  11. package/dist/scripts/scrapers/aws.d.ts.map +1 -1
  12. package/dist/scripts/scrapers/aws.js +211 -57
  13. package/dist/scripts/scrapers/aws.js.map +1 -1
  14. package/dist/scripts/scrapers/docs.d.ts +43 -0
  15. package/dist/scripts/scrapers/docs.d.ts.map +1 -0
  16. package/dist/scripts/scrapers/docs.js +91 -0
  17. package/dist/scripts/scrapers/docs.js.map +1 -0
  18. package/dist/scripts/scrapers/openai.d.ts +4 -1
  19. package/dist/scripts/scrapers/openai.d.ts.map +1 -1
  20. package/dist/scripts/scrapers/openai.js +183 -445
  21. package/dist/scripts/scrapers/openai.js.map +1 -1
  22. package/dist/scripts/scrapers/openrouter.d.ts +1 -1
  23. package/dist/scripts/scrapers/openrouter.d.ts.map +1 -1
  24. package/dist/scripts/scrapers/openrouter.js +20 -79
  25. package/dist/scripts/scrapers/openrouter.js.map +1 -1
  26. package/dist/src/models/aws.d.ts.map +1 -1
  27. package/dist/src/models/aws.js +2180 -1033
  28. package/dist/src/models/aws.js.map +1 -1
  29. package/dist/src/models/openai.d.ts.map +1 -1
  30. package/dist/src/models/openai.js +1925 -1370
  31. package/dist/src/models/openai.js.map +1 -1
  32. package/dist/src/models/openrouter.d.ts.map +1 -1
  33. package/dist/src/models/openrouter.js +15699 -4981
  34. package/dist/src/models/openrouter.js.map +1 -1
  35. package/dist/src/strict-support.d.ts +2 -1
  36. package/dist/src/strict-support.d.ts.map +1 -1
  37. package/dist/src/strict-support.js +38 -16
  38. package/dist/src/strict-support.js.map +1 -1
  39. package/dist/src/transformers/replicate/black-forest-labs-flux-1-1-pro.js +1 -1
  40. package/dist/src/transformers/replicate/black-forest-labs-flux-1-1-pro.js.map +1 -1
  41. package/dist/src/transformers/replicate/black-forest-labs-flux-pro.js +1 -1
  42. package/dist/src/transformers/replicate/black-forest-labs-flux-pro.js.map +1 -1
  43. package/dist/src/transformers/replicate/openai-gpt-image-1.js +1 -1
  44. package/dist/src/transformers/replicate/openai-gpt-image-1.js.map +1 -1
  45. package/package.json +78 -79
  46. package/scripts/codegen.ts +12 -0
  47. package/scripts/scrape.ts +13 -5
  48. package/scripts/scrapers/aws.ts +245 -76
  49. package/scripts/scrapers/docs.ts +101 -0
  50. package/scripts/scrapers/openai.ts +185 -552
  51. package/scripts/scrapers/openrouter.ts +20 -106
  52. package/src/models/aws.ts +2569 -1422
  53. package/src/models/openai.ts +2764 -2209
  54. package/src/models/openrouter.ts +15699 -4981
  55. package/src/strict-support.ts +134 -111
  56. package/src/transformers/replicate/black-forest-labs-flux-1-1-pro.ts +1 -1
  57. package/src/transformers/replicate/black-forest-labs-flux-pro.ts +1 -1
  58. package/src/transformers/replicate/openai-gpt-image-1.ts +1 -1
  59. package/dist/scripts/_regen.d.ts +0 -2
  60. package/dist/scripts/_regen.d.ts.map +0 -1
  61. package/dist/scripts/_regen.js +0 -13
  62. package/dist/scripts/_regen.js.map +0 -1
package/aeye-models.md CHANGED
@@ -1,265 +1,272 @@
1
- # @aeye/models
2
-
3
- **Static, pre-scraped model catalog** for the `@aeye` AI stack. Ships ready-to-use arrays of
4
- `ModelInfo` records (ids, pricing, capabilities, context windows, metrics, metadata) scraped from
5
- **OpenAI**, **OpenRouter**, **Replicate**, and **AWS Bedrock**, plus a hand-curated **strict-mode
6
- support** table and **Replicate request/response transformers** for models with non-standard APIs.
7
-
8
- It contains **no runtime API calls** — everything is baked into TypeScript source at scrape time.
9
- Import it, splat the data into an `AI` instance, and model selection works offline.
10
-
11
- ## When to use
12
-
13
- - You are constructing an `@aeye/ai` `AI` instance and need a `models` list to select from.
14
- - You need pricing / capability / context-window metadata for a known model id.
15
- - You are using Replicate models whose input/output shape differs from the standard `@aeye`
16
- request/response format (you need the `replicateTransformers`).
17
- - You want a model's strict-mode (JSON-Schema dialect) support without re-deriving it.
18
-
19
- If you need the **type definitions** (`ModelInfo`, `ModelOverride`, etc.), those live in
20
- `@aeye/ai` — this package only provides *data* typed against them.
21
-
22
- ## Install / import
23
-
24
- ```ts
25
- import {
26
- models, // ModelInfo[] — all providers concatenated
27
- openaiModels, // ModelInfo[] — OpenAI only
28
- openrouterModels, // ModelInfo[] — OpenRouter only
29
- replicateModels, // ModelInfo[] — Replicate only
30
- awsModels, // ModelInfo[] — AWS Bedrock only
31
- strictSupport, // ModelOverride[] — curated strict-mode overrides
32
- transformers, // Record<string, ModelTransformer> — generic registry (currently empty)
33
- replicateTransformers, // Record<string, ReplicateTransformer> — per-model Replicate adapters
34
- } from '@aeye/models';
35
- ```
36
-
37
- There is a **single entry point** — `@aeye/models`. There are no subpath exports in
38
- `package.json` (`exports` only maps `"."`). All the above come from the root.
39
-
40
- > The `version` is published in lockstep with the rest of the monorepo (currently `0.3.8`).
41
-
42
- ## What data is provided
43
-
44
- ### The model arrays
45
-
46
- Each provider array is a `ModelInfo[]` (type defined in `@aeye/ai`). The aggregate `models`
47
- array is simply `[...openaiModels, ...openrouterModels, ...replicateModels, ...awsModels]`.
48
-
49
- Approximate counts at last scrape: OpenAI ~97, OpenRouter ~344, Replicate ~304, AWS ~56.
50
-
51
- `ModelInfo` shape (from `@aeye/ai`, abbreviated to the fields populated here):
52
-
53
- ```ts
54
- interface ModelInfo {
55
- id: string; // e.g. "gpt-4o", "anthropic/claude-sonnet-4", "stability-ai/sdxl"
56
- provider: string; // "openai" | "openrouter" | "replicate" | "aws"
57
- name: string; // human-readable name
58
- contextWindow: number; // max context tokens (0 for non-text models like image OCR)
59
- maxOutputTokens?: number;
60
- tier: 'flagship' | 'efficient' | 'legacy' | 'experimental';
61
- tokenizer?: ModelTokenizer; // 'GPT' | 'Claude' | 'Gemini' | 'Other' | ...
62
- capabilities: Set<ModelCapability>; // see below
63
- supportedParameters?: Set<ModelParameter>; // 'maxTokens' | 'temperature' | 'tools' | ...
64
- pricing: ModelPricing; // see below
65
- metrics?: ModelMetrics; // tokensPerSecond, timeToFirstToken, averageRequestDuration, ...
66
- strictFormat?: 'openai' | 'anthropic' | 'google' | 'none' | string; // set via strictSupport, not in scraped data
67
- metadata?: Record<string, unknown>; // provider-specific extras (see per-provider notes)
68
- }
69
- ```
70
-
71
- **Capabilities** (`ModelCapability`): `chat`, `tools`, `vision`, `json`, `structured`,
72
- `streaming`, `reasoning`, `image`, `audio`, `hearing`, `embedding`, `zdr`, `toolsStrict`.
73
- (`toolsStrict` is *auto-derived* from `strictFormat`, not stored in the scraped files.)
74
-
75
- **Pricing** (`ModelPricing`) — text/reasoning costs are **per 1M tokens**:
76
-
77
- ```ts
78
- interface ModelPricing {
79
- text?: { input?: number; output?: number; cached?: number };
80
- audio?: { input?: number; output?: number; perSecond?: number };
81
- image?: { input?: number; output?: {...}[] };
82
- reasoning?: { input?: number; output?: number; cached?: number };
83
- embeddings?: { cost?: number };
84
- perRequest?: number; // fixed cost per request (common for Replicate)
85
- }
86
- ```
87
-
88
- ### Per-provider `metadata` differences
89
-
90
- The `metadata` bag is provider-specific. Examples observed in the generated files:
91
-
92
- - **OpenAI**: `{ knowledgeCutoff, performance, speed }`
93
- - **OpenRouter**: `{ description, defaultParameters, canonicalSlug, huggingFaceId, created, uptime }`
94
- plus `metrics: { timeToFirstToken, tokensPerSecond }`
95
- - **Replicate**: `{ owner, description, runCount, githubUrl, visibility, source, latestVersionId,
96
- cogVersion }` plus `metrics: { averageRequestDuration }`; pricing is usually `perRequest` or
97
- audio `perSecond`
98
- - **AWS Bedrock**: `{ modelArn, providerName, responseStreamingSupported, customizationsSupported,
99
- inferenceTypesSupported, inputModalities, outputModalities }`
100
-
101
- ### `strictSupport` — curated strict-mode table
102
-
103
- `strictSupport: ModelOverride[]` is the **one hand-maintained file** in `src/` (everything else is
104
- generated). It is *not* scraped — strict-mode capability is a separate axis from the provider
105
- listings. Each entry matches by `provider` + `modelPattern` (regex) or `modelId` and sets
106
- `overrides.strictFormat` to a JSON-Schema dialect family:
107
-
108
- - `'openai'` — records→array-of-pairs, optional→nullable
109
- - `'anthropic'` — closed objects, all-required, per-request budgets
110
- - `'google'` — `prefixItems`, `$ref: '#'` recursion, `propertyOrdering`
111
- - `'none'` — hard opt-out (forces lenient mode even if auto-resolution would mark it strict)
112
-
113
- Setting `strictFormat` does two things at runtime: (1) auto-derives the `'toolsStrict'`
114
- capability for model selection, and (2) pins the JSON-Schema dialect the provider emits.
115
- Pass it via the `AI` config's `modelOverrides` (see below). Edit
116
- `src/strict-support.ts` by hand as new strict-capable models ship.
117
-
118
- ### Transformers
119
-
120
- `@aeye` providers expect a standard request/response shape. Replicate models each define their
121
- own input/output schema, so they need a per-model adapter (`ModelTransformer` from `@aeye/ai`;
122
- `ReplicateTransformer = ModelTransformer<any, any, any>` in `@aeye/replicate`).
123
-
124
- - `replicateTransformers: Record<string, ReplicateTransformer>` — keyed by Replicate model id
125
- (e.g. `"black-forest-labs/flux-schnell"`). Aggregated from ~300 individual files in
126
- `src/transformers/replicate/`. Each file exports a default `{ [modelId]: transformer }` and the
127
- index spreads them together. A transformer provides operation-specific
128
- `convertRequest` / `parseResponse` / `parseChunk` hooks for `chat`, `imageGenerate`,
129
- `imageEdit`, `imageAnalyze`, etc.
130
- - `transformers: Record<string, ModelTransformer>` — a generic cross-provider registry. **Currently
131
- empty** (`src/transformers/index.ts` is a placeholder stub); prefer `replicateTransformers`.
132
-
133
- Example transformer (`black-forest-labs/flux-schnell`):
134
-
135
- ```ts
136
- {
137
- imageGenerate: {
138
- convertRequest: async (request, ctx) => ({
139
- prompt: request.prompt, num_outputs: request.n, seed: request.seed, ...request.extra,
140
- }),
141
- parseResponse: async (response, ctx) => ({
142
- images: await Promise.all(response.map(async (url) => ({ url: await toURL(url) }))),
143
- }),
144
- },
145
- }
146
- ```
147
-
148
- ## How to use it
149
-
150
- ### Wire into an `AI` instance (typical)
151
-
152
- ```ts
153
- import { AI } from '@aeye/ai';
154
- import { models, replicateTransformers, strictSupport } from '@aeye/models';
155
-
156
- const ai = new AI({
157
- providers: { /* openai, openrouter, replicate, aws ... */ },
158
- models, // the catalog to select from
159
- modelOverrides: [...strictSupport], // apply curated strict-mode dialects
160
- transformers: replicateTransformers, // adapt non-standard Replicate models
161
- });
162
- ```
163
-
164
- This mirrors how `@aeye/cletus` (`packages/cletus/src/ai.ts`) and `@aeye/ginny`
165
- (`packages/ginny/src/ai.ts`) consume the package. Model selection scores across every entry in
166
- `models`; `modelOverrides` is applied on top, so you can append your own overrides after
167
- `...strictSupport`.
168
-
169
- ### Query the data directly
170
-
171
- It is plain data — use normal array/Set operations:
172
-
173
- ```ts
174
- import { models } from '@aeye/models';
175
-
176
- // Look up by id
177
- const m = models.find(x => x.id === 'gpt-4o');
178
-
179
- // Capability filter (capabilities is a Set)
180
- const visionModels = models.filter(x => x.capabilities.has('vision'));
181
-
182
- // Cheapest text model with tools + a large context window
183
- const candidate = models
184
- .filter(x => x.capabilities.has('tools') && x.contextWindow >= 128_000)
185
- .filter(x => x.pricing.text?.input != null)
186
- .sort((a, b) => (a.pricing.text!.input! - b.pricing.text!.input!))[0];
187
-
188
- // Per-provider slices are also exported directly
189
- import { awsModels } from '@aeye/models';
190
- const bedrockClaude = awsModels.filter(x => x.id.startsWith('anthropic.'));
191
- ```
192
-
193
- ### Custom provider re-tagging
194
-
195
- `cletus` copies entries from `models` and rewrites `provider` to `'custom'` to expose the same
196
- metadata under a custom provider — a pattern you can reuse: build a `Map(models.map(m => [m.id, m]))`,
197
- clone matched entries, and override `provider`.
198
-
199
- ## How the data is generated (and how to refresh it)
200
-
201
- All of `src/models/*.ts`, `src/models/index.ts`, and `src/index.ts` are **auto-generated** — the
202
- header comment "Do not edit manually" is literal. Scrapers live in `scripts/scrapers/` and codegen
203
- in `scripts/codegen.ts` (serializes `ModelInfo[]` back into TypeScript source, including
204
- `new Set([...])` for `capabilities`/`supportedParameters`).
205
-
206
- `scripts/scrape.ts` orchestrates all four sources, then regenerates the index files. NPM scripts:
207
-
208
- | Script | What it does |
209
- |---|---|
210
- | `npm run scrape` | Scrape **all** sources and regenerate `src/index.ts` + `src/models/index.ts` |
211
- | `npm run scrape:openai` | OpenAI only (Puppeteer-scrapes OpenAI docs pages) |
212
- | `npm run scrape:openrouter` | OpenRouter only (API via `@aeye/openrouter`) |
213
- | `npm run scrape:openrouter:full` | OpenRouter + performance metrics (`--metrics`, slower) |
214
- | `npm run scrape:replicate` | Replicate models via the `replicate` npm SDK |
215
- | `npm run scrape:replicate:models` | Replicate model data only (skip transformer generation) |
216
- | `npm run scrape:replicate:chunk` | Regenerate transformers in chunks using an LLM (`gemini-3-pro-preview`) |
217
- | `npm run scrape:replicate:test` | Single-model transformer dry run |
218
- | `npm run scrape:replicate:patch` | `scripts/patch-modelinfo.ts` — patch existing model fields |
219
- | `npm run scrape:aws` | AWS Bedrock via `@aws-sdk/client-bedrock` `ListFoundationModels` |
220
- | `npm run build` / `typecheck` / `clean` | Standard `tsc` build / typecheck / clean |
221
-
222
- Source-specific notes:
223
-
224
- - **OpenAI** & **OpenRouter metrics**: use **Puppeteer** to scrape doc/model pages (needs a headless
225
- Chromium; may break if the page layout changes).
226
- - **OpenRouter**: pulls from OpenRouter API endpoints via `@aeye/openrouter` (`fetchModels`,
227
- `fetchZDRModels`, `convertOpenRouterModel`).
228
- - **Replicate**: uses the `replicate` SDK + `openapi-typescript` to turn each model's OpenAPI schema
229
- into TS types, then generates a per-model transformer (LLM-assisted; the prompt template is
230
- `scripts/scrapers/extract.md`). Responses are cached under `cache/replicate/`.
231
- - **AWS**: requires AWS credentials/region; lists Bedrock foundation models and converts via
232
- `@aeye/aws` `convertAWSModel`. `scrape:aws` accepts `--aws-region=`.
233
-
234
- After scraping, run `npm run build` to compile to `dist/` (the published `main`/`types` point at
235
- `dist/src/index.*`).
236
-
237
- ## Who consumes it
238
-
239
- - `@aeye/cletus` — `models`, `replicateTransformers`, `strictSupport`
240
- - `@aeye/ginny` — `models`, `strictSupport`
241
- - `@aeye/ai` tests (`ai.test.ts`, `embed-api`, `image-api`, `speech-api`) — for realistic model data
242
-
243
- Dependencies it pulls in: `@aeye/ai` (types), `@aeye/aws`, `@aeye/openrouter`, `@aeye/replicate`.
244
-
245
- ## Gotchas
246
-
247
- - **The data is a static snapshot and goes stale.** Pricing, context windows, new model ids, and
248
- deprecations only update when someone re-runs the scrapers and re-publishes. Treat it as a starting
249
- catalog, not a source of truth for live pricing/availability.
250
- - **`capabilities` and `supportedParameters` are `Set`s**, not arrays — use `.has(...)`, and remember
251
- `JSON.stringify` will not serialize them as arrays.
252
- - **`strictFormat` is not in the scraped files.** It only arrives via `strictSupport` →
253
- `modelOverrides`. Without splatting `strictSupport`, strict-mode capability (`toolsStrict`) is
254
- auto-resolved from provider/id heuristics at request time, not from this data.
255
- - **`contextWindow` is `0`** for non-text models (image, OCR, TTS, etc.) — don't treat `0` as
256
- "unknown"; it means "not token-based".
257
- - **`transformers` (generic) is empty** — use `replicateTransformers`. Don't expect cross-provider
258
- transformers here.
259
- - **Do not hand-edit** `src/models/*.ts` or the index files — re-scraping overwrites them. The only
260
- hand-curated source is `src/strict-support.ts`.
261
- - **Scrapers have external requirements**: Puppeteer/Chromium (OpenAI, OpenRouter metrics), AWS
262
- credentials (Bedrock), a Replicate token + an LLM key for transformer generation. They are dev-only
263
- (`devDependencies`) and not needed to *consume* the package.
264
- </content>
265
- </invoke>
1
+ # @aeye/models
2
+
3
+ **Static, pre-scraped model catalog** for the `@aeye` AI stack. Ships ready-to-use arrays of
4
+ `ModelInfo` records (ids, pricing, capabilities, context windows, metrics, metadata) scraped from
5
+ **OpenAI**, **OpenRouter**, **Replicate**, and **AWS Bedrock**, plus a hand-curated **strict-mode
6
+ support** table and **Replicate request/response transformers** for models with non-standard APIs.
7
+
8
+ It contains **no runtime API calls** — everything is baked into TypeScript source at scrape time.
9
+ Import it, splat the data into an `AI` instance, and model selection works offline.
10
+
11
+ ## When to use
12
+
13
+ - You are constructing an `@aeye/ai` `AI` instance and need a `models` list to select from.
14
+ - You need pricing / capability / context-window metadata for a known model id.
15
+ - You are using Replicate models whose input/output shape differs from the standard `@aeye`
16
+ request/response format (you need the `replicateTransformers`).
17
+ - You want a model's strict-mode (JSON-Schema dialect) support without re-deriving it.
18
+
19
+ If you need the **type definitions** (`ModelInfo`, `ModelOverride`, etc.), those live in
20
+ `@aeye/ai` — this package only provides *data* typed against them.
21
+
22
+ ## Install / import
23
+
24
+ ```ts
25
+ import {
26
+ models, // ModelInfo[] — all providers concatenated
27
+ openaiModels, // ModelInfo[] — OpenAI only
28
+ openrouterModels, // ModelInfo[] — OpenRouter only
29
+ replicateModels, // ModelInfo[] — Replicate only
30
+ awsModels, // ModelInfo[] — AWS Bedrock only
31
+ strictSupport, // ModelOverride[] — curated strict-mode overrides
32
+ transformers, // Record<string, ModelTransformer> — generic registry (currently empty)
33
+ replicateTransformers, // Record<string, ReplicateTransformer> — per-model Replicate adapters
34
+ } from '@aeye/models';
35
+ ```
36
+
37
+ There is a **single entry point** — `@aeye/models`. There are no subpath exports in
38
+ `package.json` (`exports` only maps `"."`). All the above come from the root.
39
+
40
+ > The `version` is published in lockstep with the rest of the monorepo (currently `0.3.8`).
41
+
42
+ ## What data is provided
43
+
44
+ ### The model arrays
45
+
46
+ Each provider array is a `ModelInfo[]` (type defined in `@aeye/ai`). The aggregate `models`
47
+ array is simply `[...openaiModels, ...openrouterModels, ...replicateModels, ...awsModels]`.
48
+
49
+ Approximate counts at last scrape: OpenAI ~136, OpenRouter ~677, Replicate ~304, AWS ~126.
50
+
51
+ `ModelInfo` shape (from `@aeye/ai`, abbreviated to the fields populated here):
52
+
53
+ ```ts
54
+ interface ModelInfo {
55
+ id: string; // e.g. "gpt-4o", "anthropic/claude-sonnet-4", "stability-ai/sdxl"
56
+ provider: string; // "openai" | "openrouter" | "replicate" | "aws"
57
+ name: string; // human-readable name
58
+ contextWindow: number; // max context tokens (0 for non-text models like image OCR)
59
+ maxOutputTokens?: number;
60
+ tier: 'flagship' | 'efficient' | 'legacy' | 'experimental';
61
+ tokenizer?: ModelTokenizer; // 'GPT' | 'Claude' | 'Gemini' | 'Other' | ...
62
+ capabilities: Set<ModelCapability>; // see below
63
+ supportedParameters?: Set<ModelParameter>; // 'maxTokens' | 'temperature' | 'tools' | ...
64
+ pricing: ModelPricing; // see below
65
+ metrics?: ModelMetrics; // tokensPerSecond, timeToFirstToken, averageRequestDuration, ...
66
+ strictFormat?: 'openai' | 'anthropic' | 'google' | 'none' | string; // set via strictSupport, not in scraped data
67
+ metadata?: Record<string, unknown>; // provider-specific extras (see per-provider notes)
68
+ }
69
+ ```
70
+
71
+ **Capabilities** (`ModelCapability`): `chat`, `tools`, `vision`, `json`, `structured`,
72
+ `streaming`, `reasoning`, `image`, `audio`, `hearing`, `embedding`, `zdr`, `toolsStrict`.
73
+ (`toolsStrict` is *auto-derived* from `strictFormat`, not stored in the scraped files.)
74
+
75
+ **Pricing** (`ModelPricing`) — text/reasoning costs are **per 1M tokens**:
76
+
77
+ ```ts
78
+ interface ModelPricing {
79
+ text?: { input?: number; output?: number; cached?: number };
80
+ audio?: { input?: number; output?: number; perSecond?: number };
81
+ image?: { input?: number; output?: {...}[] };
82
+ reasoning?: { input?: number; output?: number; cached?: number };
83
+ embeddings?: { cost?: number };
84
+ perRequest?: number; // fixed cost per request (common for Replicate)
85
+ }
86
+ ```
87
+
88
+ ### Per-provider `metadata` differences
89
+
90
+ The `metadata` bag is provider-specific. Examples observed in the generated files:
91
+
92
+ - **OpenAI**: `{ knowledgeCutoff, performance, speed }`
93
+ - **OpenRouter**: `{ description, defaultParameters, canonicalSlug, huggingFaceId, created, uptime }`
94
+ plus `metrics: { timeToFirstToken, tokensPerSecond }`
95
+ - **Replicate**: `{ owner, description, runCount, githubUrl, visibility, source, latestVersionId,
96
+ cogVersion }` plus `metrics: { averageRequestDuration }`; pricing is usually `perRequest` or
97
+ audio `perSecond`
98
+ - **AWS Bedrock**: `{ modelArn, providerName, responseStreamingSupported, customizationsSupported,
99
+ inferenceTypesSupported, inputModalities, outputModalities }`
100
+
101
+ ### `strictSupport` — curated strict-mode table
102
+
103
+ `strictSupport: ModelOverride[]` is the **one hand-maintained file** in `src/` (everything else is
104
+ generated). It is *not* scraped — strict-mode capability is a separate axis from the provider
105
+ listings. Each entry matches by `provider` + `modelPattern` (regex) or `modelId` and sets
106
+ `overrides.strictFormat` to a JSON-Schema dialect family:
107
+
108
+ - `'openai'` — records→array-of-pairs, optional→nullable
109
+ - `'anthropic'` — closed objects, all-required, per-request budgets
110
+ - `'google'` — `prefixItems`, `$ref: '#'` recursion, `propertyOrdering`
111
+ - `'none'` — hard opt-out (forces lenient mode even if auto-resolution would mark it strict)
112
+
113
+ Setting `strictFormat` does two things at runtime: (1) auto-derives the `'toolsStrict'`
114
+ capability for model selection, and (2) pins the JSON-Schema dialect the provider emits.
115
+ Pass it via the `AI` config's `modelOverrides` (see below). Edit
116
+ `src/strict-support.ts` by hand as new strict-capable models ship.
117
+
118
+ ### Transformers
119
+
120
+ `@aeye` providers expect a standard request/response shape. Replicate models each define their
121
+ own input/output schema, so they need a per-model adapter (`ModelTransformer` from `@aeye/ai`;
122
+ `ReplicateTransformer = ModelTransformer<any, any, any>` in `@aeye/replicate`).
123
+
124
+ - `replicateTransformers: Record<string, ReplicateTransformer>` — keyed by Replicate model id
125
+ (e.g. `"black-forest-labs/flux-schnell"`). Aggregated from ~300 individual files in
126
+ `src/transformers/replicate/`. Each file exports a default `{ [modelId]: transformer }` and the
127
+ index spreads them together. A transformer provides operation-specific
128
+ `convertRequest` / `parseResponse` / `parseChunk` hooks for `chat`, `imageGenerate`,
129
+ `imageEdit`, `imageAnalyze`, etc.
130
+ - `transformers: Record<string, ModelTransformer>` — a generic cross-provider registry. **Currently
131
+ empty** (`src/transformers/index.ts` is a placeholder stub); prefer `replicateTransformers`.
132
+
133
+ Example transformer (`black-forest-labs/flux-schnell`):
134
+
135
+ ```ts
136
+ {
137
+ imageGenerate: {
138
+ convertRequest: async (request, ctx) => ({
139
+ prompt: request.prompt, num_outputs: request.n, seed: request.seed, ...request.extra,
140
+ }),
141
+ parseResponse: async (response, ctx) => ({
142
+ images: await Promise.all(response.map(async (url) => ({ url: await toURL(url) }))),
143
+ }),
144
+ },
145
+ }
146
+ ```
147
+
148
+ ## How to use it
149
+
150
+ ### Wire into an `AI` instance (typical)
151
+
152
+ ```ts
153
+ import { AI } from '@aeye/ai';
154
+ import { models, replicateTransformers, strictSupport } from '@aeye/models';
155
+
156
+ const ai = new AI({
157
+ providers: { /* openai, openrouter, replicate, aws ... */ },
158
+ models, // the catalog to select from
159
+ modelOverrides: [...strictSupport], // apply curated strict-mode dialects
160
+ transformers: replicateTransformers, // adapt non-standard Replicate models
161
+ });
162
+ ```
163
+
164
+ This mirrors how `@aeye/cletus` (`packages/cletus/src/ai.ts`) and `@aeye/ginny`
165
+ (`packages/ginny/src/ai.ts`) consume the package. Model selection scores across every entry in
166
+ `models`; `modelOverrides` is applied on top, so you can append your own overrides after
167
+ `...strictSupport`.
168
+
169
+ ### Query the data directly
170
+
171
+ It is plain data — use normal array/Set operations:
172
+
173
+ ```ts
174
+ import { models } from '@aeye/models';
175
+
176
+ // Look up by id
177
+ const m = models.find(x => x.id === 'gpt-4o');
178
+
179
+ // Capability filter (capabilities is a Set)
180
+ const visionModels = models.filter(x => x.capabilities.has('vision'));
181
+
182
+ // Cheapest text model with tools + a large context window
183
+ const candidate = models
184
+ .filter(x => x.capabilities.has('tools') && x.contextWindow >= 128_000)
185
+ .filter(x => x.pricing.text?.input != null)
186
+ .sort((a, b) => (a.pricing.text!.input! - b.pricing.text!.input!))[0];
187
+
188
+ // Per-provider slices are also exported directly
189
+ import { awsModels } from '@aeye/models';
190
+ const bedrockClaude = awsModels.filter(x => x.id.startsWith('anthropic.'));
191
+ ```
192
+
193
+ ### Custom provider re-tagging
194
+
195
+ `cletus` copies entries from `models` and rewrites `provider` to `'custom'` to expose the same
196
+ metadata under a custom provider — a pattern you can reuse: build a `Map(models.map(m => [m.id, m]))`,
197
+ clone matched entries, and override `provider`.
198
+
199
+ ## How the data is generated (and how to refresh it)
200
+
201
+ All of `src/models/*.ts`, `src/models/index.ts`, and `src/index.ts` are **auto-generated** — the
202
+ header comment "Do not edit manually" is literal. Scrapers live in `scripts/scrapers/` and codegen
203
+ in `scripts/codegen.ts` (serializes `ModelInfo[]` back into TypeScript source, including
204
+ `new Set([...])` for `capabilities`/`supportedParameters`).
205
+
206
+ `scripts/scrape.ts` orchestrates all four sources, then regenerates the index files. NPM scripts:
207
+
208
+ | Script | What it does |
209
+ |---|---|
210
+ | `npm run scrape` | Scrape **all** sources and regenerate `src/index.ts` + `src/models/index.ts` |
211
+ | `npm run scrape:auto` | The unattended set the weekly workflow runs: OpenRouter with metrics, OpenAI, AWS |
212
+ | `npm run scrape:openai` | OpenAI only (reads the Markdown versions of OpenAI's docs pages) |
213
+ | `npm run scrape:openrouter` | OpenRouter only (API via `@aeye/openrouter`) |
214
+ | `npm run scrape:openrouter:full` | OpenRouter + performance metrics (`--metrics`, slower) |
215
+ | `npm run scrape:replicate` | Replicate models via the `replicate` npm SDK |
216
+ | `npm run scrape:replicate:models` | Replicate model data only (skip transformer generation) |
217
+ | `npm run scrape:replicate:chunk` | Regenerate transformers in chunks using an LLM (`gemini-3-pro-preview`) |
218
+ | `npm run scrape:replicate:test` | Single-model transformer dry run |
219
+ | `npm run scrape:replicate:patch` | `scripts/patch-modelinfo.ts` — patch existing model fields |
220
+ | `npm run scrape:aws` | AWS Bedrock from the user guide's model cards and the public price list (no credentials) |
221
+ | `npm run build` / `typecheck` / `clean` | Standard `tsc` build / typecheck / clean |
222
+
223
+ Source-specific notes:
224
+
225
+ - **OpenAI**: lists models through the API, then reads each model's docs page as Markdown.
226
+ - **OpenRouter metrics**: from the endpoints API (`--metrics`, one request per model).
227
+ - **OpenRouter**: pulls from OpenRouter API endpoints via `@aeye/openrouter` (`fetchModels`,
228
+ `fetchZDRModels`, `convertOpenRouterModel`).
229
+ - **Replicate**: uses the `replicate` SDK + `openapi-typescript` to turn each model's OpenAPI schema
230
+ into TS types, then generates a per-model transformer (LLM-assisted; the prompt template is
231
+ `scripts/scrapers/extract.md`). Responses are cached under `cache/replicate/`.
232
+ - **AWS**: reads the Markdown model cards of the Bedrock user guide (ids, modalities, Converse
233
+ support, features, limits, end-of-life dates) and prices them from AWS's public price list offer
234
+ files (`AmazonBedrock`, `AmazonBedrockFoundationModels`), or from a card's own pricing table.
235
+ Prices are the lowest standard on-demand rate (global cross-region inference, no regional
236
+ premium). Only models the `bedrock-runtime` endpoint serves are kept; `metadata.inRegion` is false
237
+ for models that need an inference profile (`modelPrefix`), listed in `metadata.inferenceIds`.
238
+ `scrape:aws` accepts `--region=` for the price list region (default `us-east-1`).
239
+
240
+ After scraping, run `npm run build` to compile to `dist/` (the published `main`/`types` point at
241
+ `dist/src/index.*`).
242
+
243
+ ## Who consumes it
244
+
245
+ - `@aeye/cletus` — `models`, `replicateTransformers`, `strictSupport`
246
+ - `@aeye/ginny` — `models`, `strictSupport`
247
+ - `@aeye/ai` tests (`ai.test.ts`, `embed-api`, `image-api`, `speech-api`) — for realistic model data
248
+
249
+ Dependencies it pulls in: `@aeye/ai` (types), `@aeye/aws`, `@aeye/openrouter`, `@aeye/replicate`.
250
+
251
+ ## Gotchas
252
+
253
+ - **The data is a static snapshot and goes stale.** Pricing, context windows, new model ids, and
254
+ deprecations only update when the scrapers re-run (the weekly workflow proposes OpenRouter,
255
+ OpenAI, and AWS refreshes as a draft PR) and the package is re-published. Treat it as a starting
256
+ catalog, not a source of truth for live pricing/availability.
257
+ - **`capabilities` and `supportedParameters` are `Set`s**, not arrays — use `.has(...)`, and remember
258
+ `JSON.stringify` will not serialize them as arrays.
259
+ - **`strictFormat` is not in the scraped files.** It only arrives via `strictSupport` →
260
+ `modelOverrides`. Without splatting `strictSupport`, strict-mode capability (`toolsStrict`) is
261
+ auto-resolved from provider/id heuristics at request time, not from this data.
262
+ - **`contextWindow` is `0`** for non-text models (image, OCR, TTS, etc.) — don't treat `0` as
263
+ "unknown"; it means "not token-based".
264
+ - **`transformers` (generic) is empty** — use `replicateTransformers`. Don't expect cross-provider
265
+ transformers here.
266
+ - **Do not hand-edit** `src/models/*.ts` or the index files — re-scraping overwrites them. The only
267
+ hand-curated source is `src/strict-support.ts`.
268
+ - **Scrapers have external requirements**: an OpenAI key (model list), an OpenRouter key, a
269
+ Replicate token + an LLM key for transformer generation. AWS needs none. They are dev-only
270
+ (`devDependencies`) and not needed to *consume* the package.
271
+ </content>
272
+ </invoke>
@@ -12,6 +12,10 @@ export declare function generateModelTS(models: ModelInfo[], exportName: string)
12
12
  * Write model data to TypeScript file
13
13
  */
14
14
  export declare function writeModelTS(models: ModelInfo[], exportName: string, outputPath: string): Promise<void>;
15
+ /**
16
+ * Write model data as JSON for reference, sets as arrays
17
+ */
18
+ export declare function writeModelJSON(models: ModelInfo[], outputPath: string): Promise<void>;
15
19
  /**
16
20
  * Generate the models/index.ts file that aggregates all provider models
17
21
  */
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../scripts/codegen.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,UAAU,CAAC;AAE1D,eAAO,MAAM,SAAS,GAAI,GAAG,GAAG,EAAE,QAAQ,MAAM,GAAG,MAAM,GAAG,SAAS,uBAO7C,CAAC;AAEzB,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,WAqB1C,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB/E;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAyB9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAa5C"}
1
+ {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../scripts/codegen.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,UAAU,CAAC;AAE1D,eAAO,MAAM,SAAS,GAAI,GAAG,GAAG,EAAE,QAAQ,MAAM,GAAG,MAAM,GAAG,SAAS,uBAO7C,CAAC;AAEzB,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,WAuB1C,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB/E;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAyB9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAe5C"}
@@ -23,6 +23,8 @@ export const stringifyModel = (m) => {
23
23
  [m.capabilities, `capabilities: new Set([${Array.from(m.capabilities).map(c => `'${c}'`).join(', ')}])`],
24
24
  [m.supportedParameters?.size || m.supportedParameters?.length, `supportedParameters: new Set([${Array.from(m.supportedParameters || []).map(p => `'${p}'`).join(', ')}])`],
25
25
  [m.pricing || {}, `pricing: ${stringify(m.pricing, 2)}`],
26
+ [m.reasoningEfforts?.length, `reasoningEfforts: [${(m.reasoningEfforts ?? []).map(e => `'${e}'`).join(', ')}]`],
27
+ [m.retiresAt, `retiresAt: '${m.retiresAt}'`],
26
28
  [m.metrics, `metrics: ${stringify(m.metrics, 2)}`],
27
29
  [m.metadata, `metadata: ${stringify(m.metadata, 2)}`],
28
30
  ];
@@ -58,6 +60,13 @@ export async function writeModelTS(models, exportName, outputPath) {
58
60
  await fs.mkdir(path.dirname(outputPath), { recursive: true });
59
61
  await fs.writeFile(outputPath, content, 'utf-8');
60
62
  }
63
+ /**
64
+ * Write model data as JSON for reference, sets as arrays
65
+ */
66
+ export async function writeModelJSON(models, outputPath) {
67
+ await fs.mkdir(path.dirname(outputPath), { recursive: true });
68
+ await fs.writeFile(outputPath, JSON.stringify(models, (_key, value) => value instanceof Set ? Array.from(value) : value, 2));
69
+ }
61
70
  /**
62
71
  * Generate the models/index.ts file that aggregates all provider models
63
72
  */
@@ -102,6 +111,8 @@ export function generateMainIndexTS() {
102
111
 
103
112
  export { models, openaiModels, openrouterModels, replicateModels, awsModels } from './models';
104
113
  export { transformers } from './transformers';
114
+ export { replicateTransformers } from './transformers/replicate';
115
+ export { strictSupport } from './strict-support';
105
116
  `;
106
117
  }
107
118
  //# sourceMappingURL=codegen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../scripts/codegen.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAM,EAAE,KAAmC,EAAE,EAAE;AACvE,gFAAgF;AAChF,6EAA6E;AAC7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CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAmB,EAAE,UAAkB;IAC1E,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9D,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/H,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;CAuBR,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO;;;;;;;;;;;;;CAaR,CAAC;AACF,CAAC"}
@@ -3,10 +3,11 @@
3
3
  *
4
4
  * Coordinates scraping from all sources: OpenAI, OpenRouter, Replicate, and AWS
5
5
  */
6
+ type Source = 'openai' | 'openrouter' | 'replicate' | 'aws';
6
7
  interface ScraperOptions {
7
8
  outputDir?: string;
8
9
  cacheDir?: string;
9
- sources?: ('openai' | 'openrouter' | 'replicate' | 'aws')[];
10
+ sources?: Source[];
10
11
  concurrency?: number;
11
12
  scrapeMetrics?: boolean;
12
13
  awsRegion?: string;