@aeye/models 0.3.8 → 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 (63) hide show
  1. package/aeye-models.md +272 -0
  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 +16 -1
  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/index.d.ts +1 -0
  27. package/dist/src/index.d.ts.map +1 -1
  28. package/dist/src/index.js +1 -0
  29. package/dist/src/index.js.map +1 -1
  30. package/dist/src/models/aws.d.ts.map +1 -1
  31. package/dist/src/models/aws.js +2180 -1033
  32. package/dist/src/models/aws.js.map +1 -1
  33. package/dist/src/models/openai.d.ts.map +1 -1
  34. package/dist/src/models/openai.js +1925 -1370
  35. package/dist/src/models/openai.js.map +1 -1
  36. package/dist/src/models/openrouter.d.ts.map +1 -1
  37. package/dist/src/models/openrouter.js +16017 -6383
  38. package/dist/src/models/openrouter.js.map +1 -1
  39. package/dist/src/strict-support.d.ts +45 -0
  40. package/dist/src/strict-support.d.ts.map +1 -0
  41. package/dist/src/strict-support.js +129 -0
  42. package/dist/src/strict-support.js.map +1 -0
  43. package/dist/src/transformers/replicate/black-forest-labs-flux-1-1-pro.js +1 -1
  44. package/dist/src/transformers/replicate/black-forest-labs-flux-1-1-pro.js.map +1 -1
  45. package/dist/src/transformers/replicate/black-forest-labs-flux-pro.js +1 -1
  46. package/dist/src/transformers/replicate/black-forest-labs-flux-pro.js.map +1 -1
  47. package/dist/src/transformers/replicate/openai-gpt-image-1.js +1 -1
  48. package/dist/src/transformers/replicate/openai-gpt-image-1.js.map +1 -1
  49. package/package.json +78 -79
  50. package/scripts/codegen.ts +17 -2
  51. package/scripts/scrape.ts +13 -5
  52. package/scripts/scrapers/aws.ts +245 -76
  53. package/scripts/scrapers/docs.ts +101 -0
  54. package/scripts/scrapers/openai.ts +185 -552
  55. package/scripts/scrapers/openrouter.ts +20 -106
  56. package/src/index.ts +13 -12
  57. package/src/models/aws.ts +2569 -1422
  58. package/src/models/openai.ts +2764 -2209
  59. package/src/models/openrouter.ts +19708 -10074
  60. package/src/strict-support.ts +134 -0
  61. package/src/transformers/replicate/black-forest-labs-flux-1-1-pro.ts +1 -1
  62. package/src/transformers/replicate/black-forest-labs-flux-pro.ts +1 -1
  63. package/src/transformers/replicate/openai-gpt-image-1.ts +1 -1
@@ -0,0 +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://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,