@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,520 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json",
3
+ "id": "nvidia",
4
+ "protocol_version": "2.0",
5
+ "name": "NVIDIA NIM",
6
+ "version": "1.0.0",
7
+ "status": "stable",
8
+ "category": "third_party_aggregator",
9
+ "official_url": "https://build.nvidia.com/explore/discover",
10
+ "support_contact": "https://docs.api.nvidia.com/nim/docs",
11
+ "endpoint": {
12
+ "base_url": "https://integrate.api.nvidia.com/v1",
13
+ "chat": "/chat/completions",
14
+ "auth": {
15
+ "type": "bearer",
16
+ "header": "Authorization",
17
+ "prefix": "Bearer",
18
+ "token_env": "NVIDIA_API_KEY"
19
+ }
20
+ },
21
+ "error_classification": {
22
+ "by_http_status": {
23
+ "400": "invalid_request",
24
+ "401": "authentication",
25
+ "403": "permission_denied",
26
+ "404": "not_found",
27
+ "429": "rate_limited",
28
+ "500": "server_error",
29
+ "503": "overloaded"
30
+ },
31
+ "by_error_code": {
32
+ "context_length_exceeded": "request_too_large",
33
+ "model_not_found": "not_found",
34
+ "rate_limit_exceeded": "rate_limited"
35
+ }
36
+ },
37
+ "availability": {
38
+ "required": false,
39
+ "regions": [
40
+ "global"
41
+ ],
42
+ "check": {
43
+ "method": "GET",
44
+ "path": "/models",
45
+ "expected_status": [
46
+ 200,
47
+ 401
48
+ ],
49
+ "timeout_ms": 5000
50
+ }
51
+ },
52
+ "capabilities": {
53
+ "required": [
54
+ "text",
55
+ "streaming",
56
+ "tools"
57
+ ],
58
+ "optional": [
59
+ "vision",
60
+ "parallel_tools",
61
+ "agentic",
62
+ "reasoning"
63
+ ],
64
+ "feature_flags": {
65
+ "parallel_tool_calls": true,
66
+ "streaming_usage": true,
67
+ "system_messages": true
68
+ },
69
+ "tool_calling": {
70
+ "native": {
71
+ "supported": true,
72
+ "reliability": "full",
73
+ "parallel": true
74
+ }
75
+ }
76
+ },
77
+ "parameters": {
78
+ "temperature": {
79
+ "type": "float",
80
+ "range": [
81
+ 0,
82
+ 2
83
+ ],
84
+ "default": 1
85
+ },
86
+ "max_tokens": {
87
+ "type": "integer",
88
+ "min": 1,
89
+ "max": 8192
90
+ },
91
+ "top_p": {
92
+ "type": "float",
93
+ "range": [
94
+ 0,
95
+ 1
96
+ ]
97
+ },
98
+ "stream": {
99
+ "type": "boolean"
100
+ }
101
+ },
102
+ "streaming": {
103
+ "decoder": {
104
+ "format": "sse",
105
+ "strategy": "openai_chat",
106
+ "done_signal": "[DONE]",
107
+ "prefix": "data: "
108
+ },
109
+ "content_path": "$.choices[0].delta.content",
110
+ "tool_call_path": "$.choices[0].delta.tool_calls",
111
+ "usage_path": "$.usage",
112
+ "event_map": [
113
+ {
114
+ "match": "exists($.choices[*].delta.content)",
115
+ "emit": "PartialContentDelta",
116
+ "fields": {
117
+ "content": "$.choices[*].delta.content"
118
+ }
119
+ },
120
+ {
121
+ "match": "exists($.choices[*].delta.tool_calls)",
122
+ "emit": "PartialToolCall",
123
+ "fields": {
124
+ "tool_calls": "$.choices[*].delta.tool_calls"
125
+ }
126
+ },
127
+ {
128
+ "match": "exists($.usage)",
129
+ "emit": "Metadata",
130
+ "fields": {
131
+ "usage": "$.usage"
132
+ }
133
+ },
134
+ {
135
+ "match": "$.choices[*].finish_reason != null",
136
+ "emit": "StreamEnd",
137
+ "fields": {
138
+ "finish_reason": "$.choices[*].finish_reason"
139
+ }
140
+ }
141
+ ],
142
+ "stop_condition": "$.choices[0].finish_reason != null"
143
+ },
144
+ "multimodal": {
145
+ "input": {
146
+ "vision": {
147
+ "supported": true,
148
+ "formats": [
149
+ "jpeg",
150
+ "png",
151
+ "gif",
152
+ "webp"
153
+ ],
154
+ "encoding_methods": [
155
+ "base64_inline",
156
+ "url"
157
+ ]
158
+ },
159
+ "audio": {
160
+ "supported": false
161
+ },
162
+ "video": {
163
+ "supported": false
164
+ }
165
+ },
166
+ "output": {
167
+ "text": true,
168
+ "audio": {
169
+ "supported": false
170
+ },
171
+ "image": {
172
+ "supported": false
173
+ }
174
+ }
175
+ },
176
+ "api_families": [
177
+ "chat_completions"
178
+ ],
179
+ "default_api_family": "chat_completions",
180
+ "endpoints": {
181
+ "chat": {
182
+ "path": "/chat/completions",
183
+ "method": "POST",
184
+ "adapter": "openai"
185
+ }
186
+ },
187
+ "services": {
188
+ "list_models": {
189
+ "path": "/models",
190
+ "method": "GET",
191
+ "response_binding": "data"
192
+ }
193
+ },
194
+ "retry_policy": {
195
+ "strategy": "exponential_backoff",
196
+ "max_retries": 3,
197
+ "min_delay_ms": 1000,
198
+ "max_delay_ms": 30000,
199
+ "jitter": "full",
200
+ "retry_on_http_status": [
201
+ 429,
202
+ 500,
203
+ 502,
204
+ 503
205
+ ]
206
+ },
207
+ "termination": {
208
+ "source_field": "finish_reason",
209
+ "mapping": {
210
+ "stop": "end_turn",
211
+ "length": "max_tokens",
212
+ "tool_calls": "tool_use"
213
+ }
214
+ },
215
+ "metadata": {
216
+ "api_compatibility": "openai",
217
+ "models": {
218
+ "nvidia/nemotron-3-ultra-550b-a55b": {
219
+ "context_window": 1000000,
220
+ "max_output_tokens": 8192,
221
+ "verification": {
222
+ "status": "operational",
223
+ "source": "provider_catalog",
224
+ "notes": "Flagship 550B MoE, 1M context, agentic reasoning"
225
+ }
226
+ },
227
+ "nvidia/nemotron-3-super-120b-a12b": {
228
+ "context_window": 1000000,
229
+ "max_output_tokens": 8192,
230
+ "verification": {
231
+ "status": "operational",
232
+ "source": "provider_catalog",
233
+ "notes": "120B MoE, 1M context, agentic reasoning"
234
+ }
235
+ },
236
+ "nvidia/nemotron-3-nano-30b-a3b": {
237
+ "context_window": 1000000,
238
+ "max_output_tokens": 8192,
239
+ "verification": {
240
+ "status": "operational",
241
+ "source": "provider_catalog",
242
+ "notes": "30B MoE, 1M context, efficient reasoning"
243
+ }
244
+ },
245
+ "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning": {
246
+ "context_window": 131072,
247
+ "max_output_tokens": 8192,
248
+ "verification": {
249
+ "status": "operational",
250
+ "source": "provider_catalog",
251
+ "notes": "Omni-modal (image/video/audio/text) reasoning"
252
+ }
253
+ },
254
+ "nvidia/nemotron-4-340b-instruct": {
255
+ "context_window": 128000,
256
+ "max_output_tokens": 8192,
257
+ "verification": {
258
+ "status": "operational",
259
+ "source": "provider_catalog"
260
+ }
261
+ },
262
+ "nvidia/llama-3.3-nemotron-super-49b-v1": {
263
+ "context_window": 128000,
264
+ "max_output_tokens": 8192,
265
+ "verification": {
266
+ "status": "operational",
267
+ "source": "provider_catalog",
268
+ "notes": "Llama 3.3 Nemotron Super 49B chat model"
269
+ }
270
+ },
271
+ "nvidia/llama-3.3-nemotron-super-49b-v1.5": {
272
+ "context_window": 128000,
273
+ "max_output_tokens": 8192,
274
+ "verification": {
275
+ "status": "operational",
276
+ "source": "provider_catalog",
277
+ "notes": "Updated v1.5 with improved reasoning"
278
+ }
279
+ },
280
+ "nvidia/llama-3.1-nemotron-70b-instruct": {
281
+ "context_window": 128000,
282
+ "max_output_tokens": 8192,
283
+ "verification": {
284
+ "status": "operational",
285
+ "source": "provider_catalog"
286
+ }
287
+ },
288
+ "nvidia/llama-3.1-nemotron-ultra-253b-v1": {
289
+ "context_window": 128000,
290
+ "max_output_tokens": 8192,
291
+ "verification": {
292
+ "status": "operational",
293
+ "source": "provider_catalog",
294
+ "notes": "Nemotron fine-tuned Llama 3.1 253B MoE"
295
+ }
296
+ },
297
+ "nvidia/llama3-chatqa-1.5-70b": {
298
+ "context_window": 32768,
299
+ "max_output_tokens": 4096,
300
+ "verification": {
301
+ "status": "operational",
302
+ "source": "provider_catalog"
303
+ }
304
+ },
305
+ "nvidia/nemotron-nano-12b-v2-vl": {
306
+ "context_window": 131072,
307
+ "max_output_tokens": 4096,
308
+ "verification": {
309
+ "status": "operational",
310
+ "source": "provider_catalog",
311
+ "notes": "Vision-language model for image/video understanding"
312
+ }
313
+ },
314
+ "nvidia/llama-nemotron-embed-1b-v2": {
315
+ "context_window": 512,
316
+ "max_output_tokens": 0,
317
+ "verification": {
318
+ "status": "operational",
319
+ "source": "provider_catalog"
320
+ }
321
+ },
322
+ "nvidia/nv-embed-v1": {
323
+ "context_window": 512,
324
+ "max_output_tokens": 0,
325
+ "verification": {
326
+ "status": "operational",
327
+ "source": "provider_catalog"
328
+ }
329
+ },
330
+ "deepseek-ai/deepseek-v4-flash": {
331
+ "context_window": 1000000,
332
+ "max_output_tokens": 8192,
333
+ "verification": {
334
+ "status": "operational",
335
+ "source": "provider_catalog",
336
+ "notes": "284B MoE, 13B activated, 1M context"
337
+ }
338
+ },
339
+ "deepseek-ai/deepseek-v4-pro": {
340
+ "context_window": 1000000,
341
+ "max_output_tokens": 8192,
342
+ "verification": {
343
+ "status": "operational",
344
+ "source": "provider_catalog",
345
+ "notes": "1.6T MoE, 49B activated, 1M context"
346
+ }
347
+ },
348
+ "mistralai/mistral-large-3-675b-instruct-2512": {
349
+ "context_window": 128000,
350
+ "max_output_tokens": 8192,
351
+ "verification": {
352
+ "status": "operational",
353
+ "source": "provider_catalog",
354
+ "notes": "Mistral flagship 675B MoE VLM"
355
+ }
356
+ },
357
+ "mistralai/mistral-small-4-119b-2603": {
358
+ "context_window": 256000,
359
+ "max_output_tokens": 8192,
360
+ "verification": {
361
+ "status": "operational",
362
+ "source": "provider_catalog"
363
+ }
364
+ },
365
+ "mistralai/mistral-medium-3.5-128b": {
366
+ "context_window": 128000,
367
+ "max_output_tokens": 8192,
368
+ "verification": {
369
+ "status": "operational",
370
+ "source": "provider_catalog"
371
+ }
372
+ },
373
+ "mistralai/ministral-14b-instruct-2512": {
374
+ "context_window": 256000,
375
+ "max_output_tokens": 8192,
376
+ "verification": {
377
+ "status": "operational",
378
+ "source": "provider_catalog"
379
+ }
380
+ },
381
+ "mistralai/codestral-22b-instruct-v0.1": {
382
+ "context_window": 256000,
383
+ "max_output_tokens": 8192,
384
+ "verification": {
385
+ "status": "operational",
386
+ "source": "provider_catalog",
387
+ "notes": "Coding-specialized 22B"
388
+ }
389
+ },
390
+ "qwen/qwen3.5-397b-a17b": {
391
+ "context_window": 262144,
392
+ "max_output_tokens": 81920,
393
+ "verification": {
394
+ "status": "operational",
395
+ "source": "provider_catalog",
396
+ "notes": "Qwen3.5 flagship 397B MoE, 17B activated, vision-language"
397
+ }
398
+ },
399
+ "qwen/qwen3.5-122b-a10b": {
400
+ "context_window": 262144,
401
+ "max_output_tokens": 81920,
402
+ "verification": {
403
+ "status": "operational",
404
+ "source": "provider_catalog"
405
+ }
406
+ },
407
+ "qwen/qwen3-next-80b-a3b-instruct": {
408
+ "context_window": 262144,
409
+ "max_output_tokens": 81920,
410
+ "verification": {
411
+ "status": "operational",
412
+ "source": "provider_catalog"
413
+ }
414
+ },
415
+ "moonshotai/kimi-k2.6": {
416
+ "context_window": 262144,
417
+ "max_output_tokens": 98304,
418
+ "verification": {
419
+ "status": "operational",
420
+ "source": "provider_catalog",
421
+ "notes": "1T MoE, 32B activated, agentic coding, vision"
422
+ }
423
+ },
424
+ "z-ai/glm-5.1": {
425
+ "context_window": 131072,
426
+ "max_output_tokens": 8192,
427
+ "verification": {
428
+ "status": "operational",
429
+ "source": "provider_catalog"
430
+ }
431
+ },
432
+ "minimaxai/minimax-m2.7": {
433
+ "context_window": 128000,
434
+ "max_output_tokens": 8192,
435
+ "verification": {
436
+ "status": "operational",
437
+ "source": "provider_catalog"
438
+ }
439
+ },
440
+ "google/gemma-4-31b-it": {
441
+ "context_window": 256000,
442
+ "max_output_tokens": 8192,
443
+ "verification": {
444
+ "status": "operational",
445
+ "source": "provider_catalog"
446
+ }
447
+ },
448
+ "google/diffusiongemma-26b-a4b-it": {
449
+ "context_window": 131072,
450
+ "max_output_tokens": 4096,
451
+ "verification": {
452
+ "status": "operational",
453
+ "source": "provider_catalog"
454
+ }
455
+ },
456
+ "meta/llama-4-maverick-17b-128e-instruct": {
457
+ "context_window": 1000000,
458
+ "max_output_tokens": 4096,
459
+ "verification": {
460
+ "status": "operational",
461
+ "source": "provider_catalog"
462
+ }
463
+ },
464
+ "meta/llama-3.3-70b-instruct": {
465
+ "context_window": 128000,
466
+ "max_output_tokens": 8192,
467
+ "verification": {
468
+ "status": "operational",
469
+ "source": "provider_catalog"
470
+ }
471
+ },
472
+ "stepfun-ai/step-3.7-flash": {
473
+ "context_window": 262144,
474
+ "max_output_tokens": 32768,
475
+ "verification": {
476
+ "status": "operational",
477
+ "source": "provider_catalog",
478
+ "notes": "198B MoE, 11B activated, vision-language, agentic"
479
+ }
480
+ },
481
+ "stepfun-ai/step-3.5-flash": {
482
+ "context_window": 131072,
483
+ "max_output_tokens": 16384,
484
+ "verification": {
485
+ "status": "operational",
486
+ "source": "provider_catalog"
487
+ }
488
+ },
489
+ "openai/gpt-oss-120b": {
490
+ "context_window": 128000,
491
+ "max_output_tokens": 8192,
492
+ "verification": {
493
+ "status": "operational",
494
+ "source": "provider_catalog"
495
+ }
496
+ },
497
+ "openai/gpt-oss-20b": {
498
+ "context_window": 128000,
499
+ "max_output_tokens": 8192,
500
+ "verification": {
501
+ "status": "operational",
502
+ "source": "provider_catalog"
503
+ }
504
+ },
505
+ "meta/llama-3.1-8b-instruct": {
506
+ "context_window": 128000,
507
+ "max_output_tokens": 8192,
508
+ "verification": {
509
+ "status": "operational",
510
+ "source": "provider_catalog"
511
+ }
512
+ }
513
+ },
514
+ "sdk": {
515
+ "note": "OpenAI-compatible — use openai SDK with base_url override",
516
+ "python": "openai",
517
+ "typescript": "openai"
518
+ }
519
+ }
520
+ }
@@ -3,7 +3,7 @@
3
3
  "id": "openai",
4
4
  "protocol_version": "2.0",
5
5
  "name": "OpenAI",
6
- "version": "5.3.0",
6
+ "version": "5.5.0",
7
7
  "status": "stable",
8
8
  "category": "ai_provider",
9
9
  "official_url": "https://platform.openai.com/docs",
@@ -41,6 +41,21 @@
41
41
  "server_error": "server_error"
42
42
  }
43
43
  },
44
+ "availability": {
45
+ "required": false,
46
+ "regions": [
47
+ "global"
48
+ ],
49
+ "check": {
50
+ "method": "GET",
51
+ "path": "/models",
52
+ "expected_status": [
53
+ 200,
54
+ 401
55
+ ],
56
+ "timeout_ms": 3000
57
+ }
58
+ },
44
59
  "capabilities": {
45
60
  "required": [
46
61
  "text",
@@ -69,6 +84,14 @@
69
84
  "streaming_usage": true,
70
85
  "system_messages": true,
71
86
  "image_generation": true
87
+ },
88
+ "tool_calling": {
89
+ "native": {
90
+ "supported": true,
91
+ "reliability": "full",
92
+ "parallel": true,
93
+ "streaming": true
94
+ }
72
95
  }
73
96
  },
74
97
  "capability_profile": {
@@ -385,14 +408,21 @@
385
408
  },
386
409
  "metadata": {
387
410
  "models": {
388
- "gpt-5.2": {
411
+ "gpt-5.5": {
412
+ "context_window": 1048576,
413
+ "max_output_tokens": 128000,
414
+ "release_date": "2026-06-19",
415
+ "notes": "Latest frontier model for complex reasoning and coding"
416
+ },
417
+ "gpt-5.4": {
389
418
  "context_window": 400000,
390
419
  "max_output_tokens": 16384,
391
- "release_date": "2025-12-10",
392
- "pricing": {
393
- "input_per_1m": 1.75,
394
- "output_per_1m": 14
395
- }
420
+ "release_date": "2026-03-01"
421
+ },
422
+ "gpt-5.4-mini": {
423
+ "context_window": 400000,
424
+ "max_output_tokens": 16384,
425
+ "release_date": "2026-03-01"
396
426
  },
397
427
  "gpt-5.3-codex": {
398
428
  "context_window": 400000,
@@ -403,11 +433,9 @@
403
433
  "output_per_1m": 10
404
434
  }
405
435
  },
406
- "gpt-5.3-codex-spark": {
436
+ "gpt-4o-mini": {
407
437
  "context_window": 128000,
408
- "max_output_tokens": 16384,
409
- "release_date": "2026-02-12",
410
- "status": "research_preview"
438
+ "max_output_tokens": 16384
411
439
  }
412
440
  },
413
441
  "sdk": {
@@ -3,7 +3,7 @@
3
3
  "id": "qwen",
4
4
  "protocol_version": "2.0",
5
5
  "name": "Qwen (DashScope)",
6
- "version": "3.0.0",
6
+ "version": "3.7.0",
7
7
  "status": "stable",
8
8
  "category": "ai_provider",
9
9
  "official_url": "https://help.aliyun.com/zh/model-studio",
@@ -29,6 +29,22 @@
29
29
  "503": "overloaded"
30
30
  }
31
31
  },
32
+ "availability": {
33
+ "required": false,
34
+ "regions": [
35
+ "cn",
36
+ "global"
37
+ ],
38
+ "check": {
39
+ "method": "GET",
40
+ "path": "/models",
41
+ "expected_status": [
42
+ 200,
43
+ 401
44
+ ],
45
+ "timeout_ms": 3000
46
+ }
47
+ },
32
48
  "capabilities": {
33
49
  "required": [
34
50
  "text",
@@ -52,6 +68,14 @@
52
68
  "streaming_usage": true,
53
69
  "system_messages": true,
54
70
  "image_generation": true
71
+ },
72
+ "tool_calling": {
73
+ "native": {
74
+ "supported": true,
75
+ "reliability": "full",
76
+ "parallel": true,
77
+ "streaming": true
78
+ }
55
79
  }
56
80
  },
57
81
  "capability_profile": {
@@ -102,14 +126,6 @@
102
126
  "type": "boolean"
103
127
  }
104
128
  },
105
- "parameter_mappings": {
106
- "temperature": "temperature",
107
- "max_tokens": "max_tokens",
108
- "stream": "stream",
109
- "top_p": "top_p",
110
- "tools": "tools",
111
- "tool_choice": "tool_choice"
112
- },
113
129
  "streaming": {
114
130
  "decoder": {
115
131
  "format": "sse",