@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
@@ -1,111 +1,134 @@
1
- /**
2
- * Curated strict-mode support table.
3
- *
4
- * HUMAN-CURATED. NOT auto-generated. Edit by hand as new models ship or
5
- * provider docs change. The auto-generated model files (`openai.ts`,
6
- * `aws.ts`, etc.) are scraped from provider listings and don't track
7
- * strict-mode capability on their own — strict support is a separate axis
8
- * sourced here.
9
- *
10
- * Splat into your `AI` config:
11
- *
12
- * ```ts
13
- * import { models, strictSupport } from '@aeye/models';
14
- *
15
- * const ai = new AI({
16
- * providers: { ... },
17
- * models,
18
- * modelOverrides: [...strictSupport, ...myOwnOverrides],
19
- * });
20
- * ```
21
- *
22
- * Setting `strictFormat: '<family>'` does two things:
23
- * 1. Auto-derives the `'toolsStrict'` capability for selection.
24
- * 2. Pins the JSON-Schema dialect that providers will emit.
25
- *
26
- * The dialect could often be left implicit and resolved via
27
- * `resolveStrictFormat(model)`'s fallback chain (provider name → `[family]/`
28
- * id prefix), but we set it explicitly here so the curated table is
29
- * self-documenting and so the provider doesn't have to recompute it for
30
- * every request.
31
- *
32
- * `strictFormat: 'none'` is a hard opt-out — used when an upstream source
33
- * (a scraper, a future provider plug-in) has incorrectly marked a model
34
- * strict-capable.
35
- *
36
- * References:
37
- * - https://platform.openai.com/docs/guides/structured-outputs
38
- * - https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use
39
- * - https://platform.claude.com/docs/en/build-with-claude/structured-outputs
40
- * - https://ai.google.dev/gemini-api/docs/structured-output
41
- */
42
-
43
- import type { ModelOverride } from '@aeye/ai';
44
-
45
- export const strictSupport: ModelOverride[] = [
46
- // ---------------------------------------------------------------------------
47
- // OpenAI direct — gpt-4o, gpt-4.1, gpt-5, o-series support strict tools +
48
- // outputs. gpt-realtime supports function calling (no documented support
49
- // for structured output, gated by the `'structured'` capability — which
50
- // the scraper doesn't add for realtime models). Legacy gpt-4 / gpt-3.5
51
- // are not listed: they don't get the cap, so they stay lenient.
52
- // ---------------------------------------------------------------------------
53
- {
54
- provider: 'openai',
55
- modelPattern: /^gpt-4o(\b|[-_])/,
56
- overrides: { strictFormat: 'openai' },
57
- },
58
- {
59
- provider: 'openai',
60
- modelPattern: /^gpt-4\.1(\b|[-_])/,
61
- overrides: { strictFormat: 'openai' },
62
- },
63
- {
64
- provider: 'openai',
65
- modelPattern: /^gpt-5(\b|[-_])/,
66
- overrides: { strictFormat: 'openai' },
67
- },
68
- {
69
- provider: 'openai',
70
- modelPattern: /^o[1-9](-mini|-preview|-pro)?(\b|[-_])/,
71
- overrides: { strictFormat: 'openai' },
72
- },
73
- {
74
- provider: 'openai',
75
- modelPattern: /^gpt-realtime/,
76
- overrides: { strictFormat: 'openai' },
77
- },
78
-
79
- // ---------------------------------------------------------------------------
80
- // AWS Bedrock — Anthropic-family Claude 4.5+ only. provider='aws' doesn't
81
- // resolve and the id uses '.' separators rather than '/', so the dialect
82
- // must be set explicitly here. Earlier Claude versions (3.5/3.7) don't
83
- // support strict per Anthropic docs and are deliberately not listed.
84
- // ---------------------------------------------------------------------------
85
- {
86
- provider: 'aws',
87
- modelPattern: /anthropic\.claude-(opus-4|sonnet-4|haiku-4)/,
88
- overrides: { strictFormat: 'anthropic' },
89
- },
90
-
91
- // ---------------------------------------------------------------------------
92
- // OpenRouter — keyed off the `[family]/...` id prefix. Listed here both
93
- // to add the `'toolsStrict'` capability (which the OpenRouter scraper
94
- // doesn't currently set) and to pin the dialect explicitly.
95
- // ---------------------------------------------------------------------------
96
- {
97
- provider: 'openrouter',
98
- modelPattern: /^openai\/(gpt-4o|gpt-4\.1|gpt-5|o[1-9])/,
99
- overrides: { strictFormat: 'openai' },
100
- },
101
- {
102
- provider: 'openrouter',
103
- modelPattern: /^anthropic\/claude-(opus-4|sonnet-4|haiku-4|4)/,
104
- overrides: { strictFormat: 'anthropic' },
105
- },
106
- {
107
- provider: 'openrouter',
108
- modelPattern: /^google\/gemini-(2\.0|2\.5|3|3\.1)/,
109
- overrides: { strictFormat: 'google' },
110
- },
111
- ];
1
+ /**
2
+ * Curated strict-mode support table.
3
+ *
4
+ * HUMAN-CURATED. NOT auto-generated. Edit by hand as new models ship or
5
+ * provider docs change. The auto-generated model files (`openai.ts`,
6
+ * `aws.ts`, etc.) are scraped from provider listings and don't track
7
+ * strict-mode capability on their own — strict support is a separate axis
8
+ * sourced here.
9
+ *
10
+ * Splat into your `AI` config:
11
+ *
12
+ * ```ts
13
+ * import { models, strictSupport } from '@aeye/models';
14
+ *
15
+ * const ai = new AI({
16
+ * providers: { ... },
17
+ * models,
18
+ * modelOverrides: [...strictSupport, ...myOwnOverrides],
19
+ * });
20
+ * ```
21
+ *
22
+ * Setting `strictFormat: '<family>'` does two things:
23
+ * 1. Auto-derives the `'toolsStrict'` capability for selection.
24
+ * 2. Pins the JSON-Schema dialect that providers will emit.
25
+ *
26
+ * The dialect could often be left implicit and resolved via
27
+ * `resolveStrictFormat(model)`'s fallback chain (provider name → `[family]/`
28
+ * id prefix), but we set it explicitly here so the curated table is
29
+ * self-documenting and so the provider doesn't have to recompute it for
30
+ * every request.
31
+ *
32
+ * `strictFormat: 'none'` is a hard opt-out — used when an upstream source
33
+ * (a scraper, a future provider plug-in) has incorrectly marked a model
34
+ * strict-capable.
35
+ *
36
+ * References:
37
+ * - https://developers.openai.com/api/docs/guides/structured-outputs
38
+ * - https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use
39
+ * - https://platform.claude.com/docs/en/build-with-claude/structured-outputs
40
+ * - https://ai.google.dev/gemini-api/docs/structured-output
41
+ * - https://docs.x.ai/docs/guides/structured-outputs
42
+ */
43
+
44
+ import type { ModelOverride } from '@aeye/ai';
45
+
46
+ export const strictSupport: ModelOverride[] = [
47
+ // ---------------------------------------------------------------------------
48
+ // OpenAI direct — gpt-4o, gpt-4.1, gpt-5 and later (gpt-5.x, gpt-6.x), and
49
+ // the o-series support strict tools + outputs. gpt-realtime supports
50
+ // function calling (no documented support for structured output, gated by
51
+ // the `'structured'` capability — which the scraper doesn't add for realtime
52
+ // models). Legacy gpt-4 / gpt-3.5 are not listed: they don't get the cap, so
53
+ // they stay lenient.
54
+ // ---------------------------------------------------------------------------
55
+ {
56
+ provider: 'openai',
57
+ modelPattern: /^gpt-4o(\b|[-_])/,
58
+ overrides: { strictFormat: 'openai' },
59
+ },
60
+ {
61
+ provider: 'openai',
62
+ modelPattern: /^gpt-4\.1(\b|[-_])/,
63
+ overrides: { strictFormat: 'openai' },
64
+ },
65
+ {
66
+ provider: 'openai',
67
+ modelPattern: /^(gpt-([5-9]|\d{2,})(\b|[-_.])|chat-latest$)/,
68
+ overrides: { strictFormat: 'openai' },
69
+ },
70
+ {
71
+ provider: 'openai',
72
+ modelPattern: /^o[1-9](-mini|-preview|-pro)?(\b|[-_])/,
73
+ overrides: { strictFormat: 'openai' },
74
+ },
75
+ {
76
+ provider: 'openai',
77
+ modelPattern: /^gpt-realtime/,
78
+ overrides: { strictFormat: 'openai' },
79
+ },
80
+
81
+ // ---------------------------------------------------------------------------
82
+ // AWS Bedrock — Anthropic-family Claude 4.5+ only. provider='aws' doesn't
83
+ // resolve and the id uses '.' separators rather than '/', so the dialect
84
+ // must be set explicitly here. Claude 3.x, 4, and 4.1 don't support strict
85
+ // per Anthropic docs and are deliberately not matched.
86
+ // ---------------------------------------------------------------------------
87
+ {
88
+ provider: 'aws',
89
+ modelPattern: /anthropic\.claude-((opus|sonnet|haiku)-4-[5-9]|(opus|sonnet|haiku|fable|mythos)-[5-9])/,
90
+ overrides: { strictFormat: 'anthropic' },
91
+ },
92
+
93
+ // ---------------------------------------------------------------------------
94
+ // OpenRouter — keyed off the `[family]/...` id prefix (and the `~` of
95
+ // floating `-latest` aliases). Listed here both to add the `'toolsStrict'`
96
+ // capability (which the OpenRouter scraper doesn't currently set) and to pin
97
+ // the dialect explicitly. xAI's prefix is `x-ai`, which no family resolves
98
+ // on its own. Floating aliases (`~openai/gpt-luna-latest`,
99
+ // `openai/gpt-chat-latest`) name the same models.
100
+ // ---------------------------------------------------------------------------
101
+ {
102
+ provider: 'openrouter',
103
+ modelPattern: /^~?openai\/(gpt-4o|gpt-4\.1|gpt-([5-9]|\d{2,}|[a-z]+-latest)|o[1-9])/,
104
+ overrides: { strictFormat: 'openai' },
105
+ },
106
+ {
107
+ provider: 'openrouter',
108
+ modelPattern: /^~?anthropic\/claude-((opus|sonnet|haiku)-4\.[5-9]|(opus|sonnet|haiku|fable|mythos)-([5-9]|latest))/,
109
+ overrides: { strictFormat: 'anthropic' },
110
+ },
111
+ {
112
+ provider: 'openrouter',
113
+ modelPattern: /^~?google\/gemini-([2-9]|flash|pro)/,
114
+ overrides: { strictFormat: 'google' },
115
+ },
116
+ {
117
+ provider: 'openrouter',
118
+ modelPattern: /^~?x-ai\/grok-([4-9]|latest)/,
119
+ overrides: { strictFormat: 'xai' },
120
+ },
121
+
122
+ // ---------------------------------------------------------------------------
123
+ // Open-weight models under a vendor prefix. `openai/gpt-oss-*` and
124
+ // `google/gemma-*` would otherwise resolve to the OpenAI / Gemini dialect by
125
+ // id prefix, but OpenRouter serves them from third-party hosts (Groq,
126
+ // Cerebras, DeepInfra, ...) whose json_schema support is their own — see
127
+ // docs/plans/schema-dialects-2026.md § 6.
128
+ // ---------------------------------------------------------------------------
129
+ {
130
+ provider: 'openrouter',
131
+ modelPattern: /^~?(openai\/gpt-oss|google\/gemma)/,
132
+ overrides: { strictFormat: 'none' },
133
+ },
134
+ ];
@@ -40,7 +40,7 @@ export default {
40
40
  }
41
41
 
42
42
  if (request.quality) {
43
- const qualityMap = { low: 60, medium: 80, high: 100 };
43
+ const qualityMap = { auto: 80, low: 60, medium: 80, high: 100, xhigh: 100, max: 100 };
44
44
  input.output_quality = qualityMap[request.quality] || 80;
45
45
  }
46
46
 
@@ -43,7 +43,7 @@ export default {
43
43
  }
44
44
  }
45
45
  if (request.quality) {
46
- const qualityMap = { low: 60, medium: 80, high: 100 };
46
+ const qualityMap = { auto: 80, low: 60, medium: 80, high: 100, xhigh: 100, max: 100 };
47
47
  input.output_quality = qualityMap[request.quality] || 80;
48
48
  }
49
49
  return input;
@@ -33,7 +33,7 @@ export default {
33
33
  convertRequest: async (request, ctx): Promise<Schemas["Input"]> => ({
34
34
  prompt: request.prompt,
35
35
  number_of_images: request.n,
36
- quality: request.quality,
36
+ quality: request.quality === 'xhigh' || request.quality === 'max' ? 'high' : request.quality,
37
37
  user_id: request.userIdentifier,
38
38
  ...request.extra,
39
39
  openai_api_key: request.extra?.openai_api_key,
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=_regen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_regen.d.ts","sourceRoot":"","sources":["../../scripts/_regen.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- // One-off: regenerate src/models/openrouter.ts from the last scrape's saved
2
- // modelinfo JSON, using the (now null/NaN-safe) codegen. Avoids re-scraping.
3
- import { readFile } from 'fs/promises';
4
- import * as path from 'path';
5
- import * as url from 'url';
6
- import { writeModelTS } from './codegen';
7
- const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
8
- const jsonPath = path.join(__dirname, '../data/openrouter-modelinfo.json');
9
- const outPath = path.join(__dirname, '../src/models/openrouter.ts');
10
- const data = JSON.parse(await readFile(jsonPath, 'utf8'));
11
- await writeModelTS(data, 'openrouterModels', outPath);
12
- console.log(`regenerated ${outPath} from ${data.length} models`);
13
- //# sourceMappingURL=_regen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_regen.js","sourceRoot":"","sources":["../../scripts/_regen.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC;AAC3E,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AAEpE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1D,MAAM,YAAY,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;AACtD,OAAO,CAAC,GAAG,CAAC,eAAe,OAAO,SAAS,IAAI,CAAC,MAAM,SAAS,CAAC,CAAC"}