@ailib-official/ai-protocol 0.8.4 → 1.0.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 (47) hide show
  1. package/README.md +10 -2
  2. package/dist/v1/models/deepseek-chat.json +4 -4
  3. package/dist/v1/models/gemini.json +59 -1
  4. package/dist/v1/providers/gemini.json +11 -1
  5. package/dist/v2/contracts/anthropic-messages.contract.json +62 -0
  6. package/dist/v2/contracts/gemini-generate.contract.json +59 -0
  7. package/dist/v2/providers/anthropic.json +42 -10
  8. package/dist/v2/providers/cohere.json +21 -0
  9. package/dist/v2/providers/deepseek.json +121 -47
  10. package/dist/v2/providers/doubao.json +23 -8
  11. package/dist/v2/providers/google.json +39 -0
  12. package/dist/v2/providers/groq.json +223 -0
  13. package/dist/v2/providers/jina.json +15 -0
  14. package/dist/v2/providers/moonshot.json +23 -8
  15. package/dist/v2/providers/nvidia.json +520 -0
  16. package/dist/v2/providers/openai.json +39 -11
  17. package/dist/v2/providers/qwen.json +25 -9
  18. package/dist/v2/providers/zhipu.json +114 -22
  19. package/package.json +12 -3
  20. package/schemas/v1.json +1 -1
  21. package/schemas/v2/availability.json +12 -0
  22. package/schemas/v2/capabilities.json +4 -0
  23. package/schemas/v2/error-codes.yaml +5 -0
  24. package/schemas/v2/metadata-model-entry.json +57 -0
  25. package/schemas/v2/pack.json +145 -0
  26. package/schemas/v2/provider-contract.json +45 -0
  27. package/schemas/v2/provider.json +15 -2
  28. package/schemas/v2/tool-calling.json +61 -0
  29. package/v1/models/deepseek-chat.yaml +4 -4
  30. package/v1/models/gemini.yaml +31 -1
  31. package/v1/providers/gemini.yaml +10 -2
  32. package/v2/contracts/anthropic-messages.contract.yaml +55 -0
  33. package/v2/contracts/gemini-generate.contract.yaml +52 -0
  34. package/v2/packs/examples/README.md +9 -0
  35. package/v2/packs/examples/deepseek-economy-pack.json +43 -0
  36. package/v2/providers/anthropic.yaml +34 -13
  37. package/v2/providers/cohere.yaml +16 -3
  38. package/v2/providers/deepseek.yaml +77 -33
  39. package/v2/providers/doubao.yaml +18 -8
  40. package/v2/providers/google.yaml +32 -4
  41. package/v2/providers/groq.yaml +159 -0
  42. package/v2/providers/jina.yaml +10 -0
  43. package/v2/providers/moonshot.yaml +20 -12
  44. package/v2/providers/nvidia.yaml +405 -0
  45. package/v2/providers/openai.yaml +33 -11
  46. package/v2/providers/qwen.yaml +20 -9
  47. package/v2/providers/zhipu.yaml +70 -23
@@ -0,0 +1,405 @@
1
+ # NVIDIA NIM V2 provider — OpenAI-compatible chat completions (Eos default aggregator)
2
+ # Last Updated: 2026-06-26 (add tool_calling)
3
+ $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
4
+
5
+ id: nvidia
6
+ protocol_version: "2.0"
7
+ name: "NVIDIA NIM"
8
+ version: "1.0.0"
9
+ status: stable
10
+ category: third_party_aggregator
11
+ official_url: "https://build.nvidia.com/explore/discover"
12
+ support_contact: "https://docs.api.nvidia.com/nim/docs"
13
+
14
+ endpoint:
15
+ base_url: "https://integrate.api.nvidia.com/v1"
16
+ chat: "/chat/completions"
17
+ auth:
18
+ type: "bearer"
19
+ header: "Authorization"
20
+ prefix: "Bearer"
21
+ token_env: "NVIDIA_API_KEY"
22
+
23
+ error_classification:
24
+ by_http_status:
25
+ "400": "invalid_request"
26
+ "401": "authentication"
27
+ "403": "permission_denied"
28
+ "404": "not_found"
29
+ "429": "rate_limited"
30
+ "500": "server_error"
31
+ "503": "overloaded"
32
+ by_error_code:
33
+ "context_length_exceeded": "request_too_large"
34
+ "model_not_found": "not_found"
35
+ "rate_limit_exceeded": "rate_limited"
36
+
37
+ availability:
38
+ required: false
39
+ regions:
40
+ - global
41
+ check:
42
+ method: GET
43
+ path: "/models"
44
+ expected_status: [200, 401]
45
+ timeout_ms: 5000
46
+
47
+ capabilities:
48
+ required:
49
+ - text
50
+ - streaming
51
+ - tools
52
+ optional:
53
+ - vision
54
+ - parallel_tools
55
+ - agentic
56
+ - reasoning
57
+ feature_flags:
58
+ parallel_tool_calls: true
59
+ streaming_usage: true
60
+ system_messages: true
61
+
62
+ tool_calling:
63
+ native:
64
+ supported: true
65
+ reliability: "full"
66
+ parallel: true
67
+
68
+ parameters:
69
+ temperature: { type: float, range: [0.0, 2.0], default: 1.0 }
70
+ max_tokens: { type: integer, min: 1, max: 8192 }
71
+ top_p: { type: float, range: [0.0, 1.0] }
72
+ stream: { type: boolean }
73
+
74
+ streaming:
75
+ decoder:
76
+ format: "sse"
77
+ strategy: "openai_chat"
78
+ done_signal: "[DONE]"
79
+ prefix: "data: "
80
+ content_path: "$.choices[0].delta.content"
81
+ tool_call_path: "$.choices[0].delta.tool_calls"
82
+ usage_path: "$.usage"
83
+ event_map:
84
+ - match: "exists($.choices[*].delta.content)"
85
+ emit: "PartialContentDelta"
86
+ fields:
87
+ content: "$.choices[*].delta.content"
88
+ - match: "exists($.choices[*].delta.tool_calls)"
89
+ emit: "PartialToolCall"
90
+ fields:
91
+ tool_calls: "$.choices[*].delta.tool_calls"
92
+ - match: "exists($.usage)"
93
+ emit: "Metadata"
94
+ fields:
95
+ usage: "$.usage"
96
+ - match: "$.choices[*].finish_reason != null"
97
+ emit: "StreamEnd"
98
+ fields:
99
+ finish_reason: "$.choices[*].finish_reason"
100
+ stop_condition: "$.choices[0].finish_reason != null"
101
+
102
+ multimodal:
103
+ input:
104
+ vision:
105
+ supported: true
106
+ formats: [jpeg, png, gif, webp]
107
+ encoding_methods: [base64_inline, url]
108
+ audio:
109
+ supported: false
110
+ video:
111
+ supported: false
112
+ output:
113
+ text: true
114
+ audio:
115
+ supported: false
116
+ image:
117
+ supported: false
118
+
119
+ api_families: ["chat_completions"]
120
+ default_api_family: "chat_completions"
121
+
122
+ endpoints:
123
+ chat:
124
+ path: "/chat/completions"
125
+ method: "POST"
126
+ adapter: "openai"
127
+
128
+ services:
129
+ list_models:
130
+ path: "/models"
131
+ method: "GET"
132
+ response_binding: "data"
133
+
134
+ retry_policy:
135
+ strategy: "exponential_backoff"
136
+ max_retries: 3
137
+ min_delay_ms: 1000
138
+ max_delay_ms: 30000
139
+ jitter: "full"
140
+ retry_on_http_status: [429, 500, 502, 503]
141
+
142
+ termination:
143
+ source_field: "finish_reason"
144
+ mapping:
145
+ stop: "end_turn"
146
+ length: "max_tokens"
147
+ tool_calls: "tool_use"
148
+
149
+ metadata:
150
+ api_compatibility: openai
151
+ models:
152
+ # NVIDIA Nemotron Series
153
+ nvidia/nemotron-3-ultra-550b-a55b:
154
+ context_window: 1000000
155
+ max_output_tokens: 8192
156
+ verification:
157
+ status: operational
158
+ source: provider_catalog
159
+ notes: "Flagship 550B MoE, 1M context, agentic reasoning"
160
+ nvidia/nemotron-3-super-120b-a12b:
161
+ context_window: 1000000
162
+ max_output_tokens: 8192
163
+ verification:
164
+ status: operational
165
+ source: provider_catalog
166
+ notes: "120B MoE, 1M context, agentic reasoning"
167
+ nvidia/nemotron-3-nano-30b-a3b:
168
+ context_window: 1000000
169
+ max_output_tokens: 8192
170
+ verification:
171
+ status: operational
172
+ source: provider_catalog
173
+ notes: "30B MoE, 1M context, efficient reasoning"
174
+ nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:
175
+ context_window: 131072
176
+ max_output_tokens: 8192
177
+ verification:
178
+ status: operational
179
+ source: provider_catalog
180
+ notes: "Omni-modal (image/video/audio/text) reasoning"
181
+ nvidia/nemotron-4-340b-instruct:
182
+ context_window: 128000
183
+ max_output_tokens: 8192
184
+ verification:
185
+ status: operational
186
+ source: provider_catalog
187
+ nvidia/llama-3.3-nemotron-super-49b-v1:
188
+ context_window: 128000
189
+ max_output_tokens: 8192
190
+ verification:
191
+ status: operational
192
+ source: provider_catalog
193
+ notes: "Llama 3.3 Nemotron Super 49B chat model"
194
+ nvidia/llama-3.3-nemotron-super-49b-v1.5:
195
+ context_window: 128000
196
+ max_output_tokens: 8192
197
+ verification:
198
+ status: operational
199
+ source: provider_catalog
200
+ notes: "Updated v1.5 with improved reasoning"
201
+ nvidia/llama-3.1-nemotron-70b-instruct:
202
+ context_window: 128000
203
+ max_output_tokens: 8192
204
+ verification:
205
+ status: operational
206
+ source: provider_catalog
207
+ nvidia/llama-3.1-nemotron-ultra-253b-v1:
208
+ context_window: 128000
209
+ max_output_tokens: 8192
210
+ verification:
211
+ status: operational
212
+ source: provider_catalog
213
+ notes: "Nemotron fine-tuned Llama 3.1 253B MoE"
214
+ nvidia/llama3-chatqa-1.5-70b:
215
+ context_window: 32768
216
+ max_output_tokens: 4096
217
+ verification:
218
+ status: operational
219
+ source: provider_catalog
220
+ nvidia/nemotron-nano-12b-v2-vl:
221
+ context_window: 131072
222
+ max_output_tokens: 4096
223
+ verification:
224
+ status: operational
225
+ source: provider_catalog
226
+ notes: "Vision-language model for image/video understanding"
227
+
228
+ # Embedding Models
229
+ nvidia/llama-nemotron-embed-1b-v2:
230
+ context_window: 512
231
+ max_output_tokens: 0
232
+ verification:
233
+ status: operational
234
+ source: provider_catalog
235
+ nvidia/nv-embed-v1:
236
+ context_window: 512
237
+ max_output_tokens: 0
238
+ verification:
239
+ status: operational
240
+ source: provider_catalog
241
+
242
+ # DeepSeek
243
+ deepseek-ai/deepseek-v4-flash:
244
+ context_window: 1000000
245
+ max_output_tokens: 8192
246
+ verification:
247
+ status: operational
248
+ source: provider_catalog
249
+ notes: "284B MoE, 13B activated, 1M context"
250
+ deepseek-ai/deepseek-v4-pro:
251
+ context_window: 1000000
252
+ max_output_tokens: 8192
253
+ verification:
254
+ status: operational
255
+ source: provider_catalog
256
+ notes: "1.6T MoE, 49B activated, 1M context"
257
+
258
+ # Mistral
259
+ mistralai/mistral-large-3-675b-instruct-2512:
260
+ context_window: 128000
261
+ max_output_tokens: 8192
262
+ verification:
263
+ status: operational
264
+ source: provider_catalog
265
+ notes: "Mistral flagship 675B MoE VLM"
266
+ mistralai/mistral-small-4-119b-2603:
267
+ context_window: 256000
268
+ max_output_tokens: 8192
269
+ verification:
270
+ status: operational
271
+ source: provider_catalog
272
+ mistralai/mistral-medium-3.5-128b:
273
+ context_window: 128000
274
+ max_output_tokens: 8192
275
+ verification:
276
+ status: operational
277
+ source: provider_catalog
278
+ mistralai/ministral-14b-instruct-2512:
279
+ context_window: 256000
280
+ max_output_tokens: 8192
281
+ verification:
282
+ status: operational
283
+ source: provider_catalog
284
+ mistralai/codestral-22b-instruct-v0.1:
285
+ context_window: 256000
286
+ max_output_tokens: 8192
287
+ verification:
288
+ status: operational
289
+ source: provider_catalog
290
+ notes: "Coding-specialized 22B"
291
+
292
+ # Qwen
293
+ qwen/qwen3.5-397b-a17b:
294
+ context_window: 262144
295
+ max_output_tokens: 81920
296
+ verification:
297
+ status: operational
298
+ source: provider_catalog
299
+ notes: "Qwen3.5 flagship 397B MoE, 17B activated, vision-language"
300
+ qwen/qwen3.5-122b-a10b:
301
+ context_window: 262144
302
+ max_output_tokens: 81920
303
+ verification:
304
+ status: operational
305
+ source: provider_catalog
306
+ qwen/qwen3-next-80b-a3b-instruct:
307
+ context_window: 262144
308
+ max_output_tokens: 81920
309
+ verification:
310
+ status: operational
311
+ source: provider_catalog
312
+
313
+ # Moonshot / Kimi
314
+ moonshotai/kimi-k2.6:
315
+ context_window: 262144
316
+ max_output_tokens: 98304
317
+ verification:
318
+ status: operational
319
+ source: provider_catalog
320
+ notes: "1T MoE, 32B activated, agentic coding, vision"
321
+
322
+ # Z.ai / GLM
323
+ z-ai/glm-5.1:
324
+ context_window: 131072
325
+ max_output_tokens: 8192
326
+ verification:
327
+ status: operational
328
+ source: provider_catalog
329
+
330
+ # MiniMax
331
+ minimaxai/minimax-m2.7:
332
+ context_window: 128000
333
+ max_output_tokens: 8192
334
+ verification:
335
+ status: operational
336
+ source: provider_catalog
337
+
338
+ # Google
339
+ google/gemma-4-31b-it:
340
+ context_window: 256000
341
+ max_output_tokens: 8192
342
+ verification:
343
+ status: operational
344
+ source: provider_catalog
345
+ google/diffusiongemma-26b-a4b-it:
346
+ context_window: 131072
347
+ max_output_tokens: 4096
348
+ verification:
349
+ status: operational
350
+ source: provider_catalog
351
+
352
+ # Meta / Llama
353
+ meta/llama-4-maverick-17b-128e-instruct:
354
+ context_window: 1000000
355
+ max_output_tokens: 4096
356
+ verification:
357
+ status: operational
358
+ source: provider_catalog
359
+ meta/llama-3.3-70b-instruct:
360
+ context_window: 128000
361
+ max_output_tokens: 8192
362
+ verification:
363
+ status: operational
364
+ source: provider_catalog
365
+
366
+ # StepFun
367
+ stepfun-ai/step-3.7-flash:
368
+ context_window: 262144
369
+ max_output_tokens: 32768
370
+ verification:
371
+ status: operational
372
+ source: provider_catalog
373
+ notes: "198B MoE, 11B activated, vision-language, agentic"
374
+ stepfun-ai/step-3.5-flash:
375
+ context_window: 131072
376
+ max_output_tokens: 16384
377
+ verification:
378
+ status: operational
379
+ source: provider_catalog
380
+
381
+ # OpenAI OSS
382
+ openai/gpt-oss-120b:
383
+ context_window: 128000
384
+ max_output_tokens: 8192
385
+ verification:
386
+ status: operational
387
+ source: provider_catalog
388
+ openai/gpt-oss-20b:
389
+ context_window: 128000
390
+ max_output_tokens: 8192
391
+ verification:
392
+ status: operational
393
+ source: provider_catalog
394
+
395
+ # Legacy chat model (provider catalog)
396
+ meta/llama-3.1-8b-instruct:
397
+ context_window: 128000
398
+ max_output_tokens: 8192
399
+ verification:
400
+ status: operational
401
+ source: provider_catalog
402
+ sdk:
403
+ note: "OpenAI-compatible — use openai SDK with base_url override"
404
+ python: openai
405
+ typescript: openai
@@ -1,14 +1,13 @@
1
- # OpenAI V2 正式提供商清单 — 合并 v2-alpha 结构与最新模型数据
2
- # AI-Protocol V2 Provider Manifest
3
- # Provider: OpenAI | Models: GPT-5.x series
4
- # Last Updated: 2026-02-19
1
+ # OpenAI V2 Provider Manifest
2
+ # Provider: OpenAI | Models: GPT-5.5 / GPT-5.4 / GPT-5.4-mini
3
+ # Last Updated: 2026-06-26 (GPT-5→5.5, add tool_calling)
5
4
  $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
6
5
 
7
6
  # === Ring 1: Core Skeleton ===
8
7
  id: openai
9
8
  protocol_version: "2.0"
10
9
  name: "OpenAI"
11
- version: "5.3.0"
10
+ version: "5.5.0"
12
11
  status: stable
13
12
  category: ai_provider
14
13
  official_url: "https://platform.openai.com/docs"
@@ -44,6 +43,16 @@ error_classification:
44
43
  "insufficient_quota": "quota_exhausted"
45
44
  "server_error": "server_error"
46
45
 
46
+ availability:
47
+ required: false
48
+ regions:
49
+ - global
50
+ check:
51
+ method: GET
52
+ path: "/models"
53
+ expected_status: [200, 401]
54
+ timeout_ms: 3000
55
+
47
56
  # === Ring 2: Capability Mapping ===
48
57
  capabilities:
49
58
  required:
@@ -72,6 +81,13 @@ capabilities:
72
81
  system_messages: true
73
82
  image_generation: true
74
83
 
84
+ tool_calling:
85
+ native:
86
+ supported: true
87
+ reliability: "full"
88
+ parallel: true
89
+ streaming: true
90
+
75
91
  capability_profile:
76
92
  phase: "ios_v1"
77
93
  inputs:
@@ -245,21 +261,27 @@ termination:
245
261
 
246
262
  metadata:
247
263
  models:
248
- gpt-5.2:
264
+ gpt-5.5:
265
+ context_window: 1048576
266
+ max_output_tokens: 128000
267
+ release_date: "2026-06-19"
268
+ notes: "Latest frontier model for complex reasoning and coding"
269
+ gpt-5.4:
270
+ context_window: 400000
271
+ max_output_tokens: 16384
272
+ release_date: "2026-03-01"
273
+ gpt-5.4-mini:
249
274
  context_window: 400000
250
275
  max_output_tokens: 16384
251
- release_date: "2025-12-10"
252
- pricing: { input_per_1m: 1.75, output_per_1m: 14.00 }
276
+ release_date: "2026-03-01"
253
277
  gpt-5.3-codex:
254
278
  context_window: 400000
255
279
  max_output_tokens: 16384
256
280
  release_date: "2026-02-05"
257
281
  pricing: { input_per_1m: 1.25, output_per_1m: 10.00 }
258
- gpt-5.3-codex-spark:
282
+ gpt-4o-mini:
259
283
  context_window: 128000
260
284
  max_output_tokens: 16384
261
- release_date: "2026-02-12"
262
- status: research_preview
263
285
  sdk:
264
286
  python: openai
265
287
  typescript: openai
@@ -1,10 +1,11 @@
1
1
  # Qwen V2 provider manifest — P0 multimodal generative coverage
2
+ # Last Updated: 2026-06-26 (add tool_calling, Qwen3→3.7)
2
3
  $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
3
4
 
4
5
  id: qwen
5
6
  protocol_version: "2.0"
6
7
  name: "Qwen (DashScope)"
7
- version: "3.0.0"
8
+ version: "3.7.0"
8
9
  status: stable
9
10
  category: ai_provider
10
11
  official_url: "https://help.aliyun.com/zh/model-studio"
@@ -29,6 +30,17 @@ error_classification:
29
30
  "500": "server_error"
30
31
  "503": "overloaded"
31
32
 
33
+ availability:
34
+ required: false
35
+ regions:
36
+ - cn
37
+ - global
38
+ check:
39
+ method: GET
40
+ path: "/models"
41
+ expected_status: [200, 401]
42
+ timeout_ms: 3000
43
+
32
44
  capabilities:
33
45
  required:
34
46
  - text
@@ -51,6 +63,13 @@ capabilities:
51
63
  system_messages: true
52
64
  image_generation: true
53
65
 
66
+ tool_calling:
67
+ native:
68
+ supported: true
69
+ reliability: "full"
70
+ parallel: true
71
+ streaming: true
72
+
54
73
  capability_profile:
55
74
  phase: "ios_v1"
56
75
  inputs:
@@ -66,14 +85,6 @@ parameters:
66
85
  top_p: { type: float, range: [0.0, 1.0] }
67
86
  stream: { type: boolean }
68
87
 
69
- parameter_mappings:
70
- temperature: "temperature"
71
- max_tokens: "max_tokens"
72
- stream: "stream"
73
- top_p: "top_p"
74
- tools: "tools"
75
- tool_choice: "tool_choice"
76
-
77
88
  streaming:
78
89
  decoder:
79
90
  format: "sse"