ai-speedometer 1.2.0 → 1.2.1

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.
package/docs/README.md CHANGED
@@ -7,6 +7,7 @@ Welcome to the documentation for the AI Speedometer benchmark CLI. This document
7
7
  - [User Guide](README.md) - Main README with installation and usage
8
8
  - [Bug Fixes v1.0](bug-fixes-v1.md) - Critical issues resolved in latest version
9
9
  - [Models.dev Integration](models-dev-integration.md) - How provider and model loading works
10
+ - [Custom Verified Providers](custom-verified-providers.md) - Adding and configuring custom verified providers
10
11
 
11
12
  ## Documentation Structure
12
13
 
@@ -26,12 +27,14 @@ Welcome to the documentation for the AI Speedometer benchmark CLI. This document
26
27
 
27
28
  #### Architecture
28
29
  - [Models.dev Integration](models-dev-integration.md) - Provider ecosystem and API integration
30
+ - [Custom Verified Providers](custom-verified-providers.md) - Pre-configured provider setup and management
29
31
  - [Bug Fixes](bug-fixes-v1.md) - Critical issues and their solutions
30
32
 
31
33
  #### Configuration
32
34
  - **Provider Configuration** - Setting up different AI providers
33
35
  - **Authentication** - API key management and security
34
36
  - **Custom Providers** - Adding your own AI providers
37
+ - **Custom Verified Providers** - Pre-configured trusted providers
35
38
 
36
39
  #### Development
37
40
  - **Code Structure** - Organization of modules and components
@@ -42,14 +45,19 @@ Welcome to the documentation for the AI Speedometer benchmark CLI. This document
42
45
 
43
46
  ### Providers and Models
44
47
 
45
- The system supports two types of providers:
48
+ The system supports three types of providers:
46
49
 
47
50
  1. **Verified Providers** - From models.dev ecosystem
48
51
  - OpenAI, Anthropic, Google, and other major providers
49
52
  - Automatically updated with latest models
50
53
  - Pre-configured endpoints and authentication
51
54
 
52
- 2. **Custom Providers** - User-defined providers
55
+ 2. **Custom Verified Providers** - Pre-configured trusted providers
56
+ - Curated providers not in models.dev but treated as verified
57
+ - Pre-configured with specific models and endpoints
58
+ - Available in `custom-verified-providers.json`
59
+
60
+ 3. **Custom Providers** - User-defined providers
53
61
  - Your own AI endpoints or local models
54
62
  - Full configuration flexibility
55
63
  - Support for OpenAI-compatible APIs
@@ -96,6 +104,15 @@ See [Bug Fixes v1.0](bug-fixes-v1.md) for detailed technical information.
96
104
 
97
105
  See [Models.dev Integration](models-dev-integration.md) for complete architectural details.
98
106
 
107
+ ### Custom Verified Providers
108
+
109
+ - **Pre-configured Providers** - Curated list of trusted providers not in models.dev
110
+ - **Structured Configuration** - Standardized format for provider definitions
111
+ - **Model Management** - Predefined models with display names and API IDs
112
+ - **Authentication Integration** - Seamless integration with existing auth system
113
+
114
+ See [Custom Verified Providers](custom-verified-providers.md) for complete setup and configuration guide.
115
+
99
116
  ## Getting Help
100
117
 
101
118
  ### Troubleshooting
@@ -134,6 +151,7 @@ We welcome contributions! See the main project README for guidelines on:
134
151
  | [Main README](../README.md) | Installation, setup, and basic usage | Users |
135
152
  | [Bug Fixes v1.0](bug-fixes-v1.md) | Critical issues and solutions | Developers/Users |
136
153
  | [Models.dev Integration](models-dev-integration.md) | Provider ecosystem architecture | Developers |
154
+ | [Custom Verified Providers](custom-verified-providers.md) | Pre-configured provider setup | Developers/Users |
137
155
 
138
156
  ## Quick Links
139
157
 
@@ -0,0 +1,463 @@
1
+ # Custom Verified Providers Guide
2
+
3
+ ## Overview
4
+
5
+ Custom Verified Providers are pre-configured AI providers that are not part of the main models.dev ecosystem but are treated as "verified" within the AI Speedometer system. These providers have predefined configurations and models that users can access with their own API keys.
6
+
7
+ This guide explains how custom verified providers work, their configuration structure, and how to add or modify them.
8
+
9
+ ## What are Custom Verified Providers?
10
+
11
+ Custom Verified Providers bridge the gap between:
12
+
13
+ 1. **Official Verified Providers** (from models.dev) - OpenAI, Anthropic, Google, etc.
14
+ 2. **User-Defined Custom Providers** - Completely user-configured endpoints
15
+
16
+ Custom Verified Providers are:
17
+ - **Pre-configured** by the AI Speedometer team
18
+ - **Curated** for quality and reliability
19
+ - **Structured** with specific models and endpoints
20
+ - **Treated as verified** in the user interface
21
+
22
+ ## Configuration Structure
23
+
24
+ The custom verified providers are stored in `custom-verified-providers.json` in the project root. Here's the complete structure:
25
+
26
+ ### Root Structure
27
+ ```json
28
+ {
29
+ "custom-verified-providers": {
30
+ "provider-id": {
31
+ // Provider configuration
32
+ },
33
+ "another-provider": {
34
+ // Provider configuration
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ ### Provider Configuration
41
+
42
+ Each provider has the following structure:
43
+
44
+ #### Basic Provider
45
+ ```json
46
+ {
47
+ "id": "provider-id",
48
+ "name": "Provider Display Name",
49
+ "baseUrl": "https://api.provider.com/v1",
50
+ "type": "openai-compatible",
51
+ "models": {
52
+ "model-id": {
53
+ "id": "model-id",
54
+ "name": "Model Display Name"
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ #### Provider Types
61
+
62
+ The `type` field determines which SDK and authentication method to use:
63
+
64
+ | Type | SDK Package | Authentication | Base URL Pattern |
65
+ |------|-------------|----------------|------------------|
66
+ | `openai-compatible` | `@ai-sdk/openai-compatible` | Bearer token | `https://api.example.com/v1` |
67
+ | `anthropic` | `@ai-sdk/anthropic` | x-api-key header | `https://api.anthropic.com` |
68
+ | `google` | `@ai-sdk/google` | x-goog-api-key header | `https://generativelanguage.googleapis.com` |
69
+
70
+ ### Models Configuration
71
+
72
+ Models are nested objects within each provider:
73
+
74
+ ```json
75
+ "models": {
76
+ "model-unique-id": {
77
+ "id": "model-api-id",
78
+ "name": "Human-Readable Model Name"
79
+ },
80
+ "another-model": {
81
+ "id": "another-model-api-id",
82
+ "name": "Another Model Name"
83
+ }
84
+ }
85
+ ```
86
+
87
+ **Key Points:**
88
+ - **Object Key**: Used internally for identification (should be unique)
89
+ - **id**: The actual model ID passed to the API
90
+ - **name**: Display name shown in the CLI interface
91
+
92
+ ## Complete Example
93
+
94
+ Here's a complete example from the current configuration:
95
+
96
+ ```json
97
+ {
98
+ "custom-verified-providers": {
99
+ "zai-code-anth": {
100
+ "id": "zai-code-anth",
101
+ "name": "zai-code-anth",
102
+ "baseUrl": "https://api.z.ai/api/anthropic/v1",
103
+ "type": "anthropic",
104
+ "models": {
105
+ "glm-4-5": {
106
+ "id": "glm-4.5",
107
+ "name": "GLM-4.5-anth"
108
+ },
109
+ "glm-4-5-air": {
110
+ "id": "glm-4.5-air",
111
+ "name": "GLM-4.5-air-anth"
112
+ }
113
+ }
114
+ },
115
+ "nanogpt-plan": {
116
+ "id": "nanogpt-plan",
117
+ "name": "nanogpt-plan",
118
+ "baseUrl": "https://nano-gpt.com/api/v1",
119
+ "type": "openai-compatible",
120
+ "models": {
121
+ "deepseek-ai/DeepSeek-V3.1-Terminus": {
122
+ "id": "deepseek-ai/DeepSeek-V3.1-Terminus",
123
+ "name": "DeepSeek V3.1 Terminus"
124
+ },
125
+ "zai-org/GLM-4.5-FP8": {
126
+ "id": "zai-org/GLM-4.5-FP8",
127
+ "name": "GLM 4.5 FP8"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ ## How Custom Verified Providers Work
136
+
137
+ ### Integration Flow
138
+
139
+ 1. **Loading**: The system reads `custom-verified-providers.json` on startup
140
+ 2. **Merging**: Custom verified providers are merged with models.dev providers
141
+ 3. **Authentication**: Users add API keys through the CLI interface
142
+ 4. **Availability**: Providers appear in the model selection interface
143
+
144
+ ### User Experience
145
+
146
+ Users see custom verified providers alongside official models.dev providers:
147
+
148
+ ```
149
+ Available Providers:
150
+ ├── OpenAI (models.dev)
151
+ ├── Anthropic (models.dev)
152
+ ├── zai-code-anth (custom verified)
153
+ ├── nanogpt-plan (custom verified)
154
+ └── [Add Custom Provider]
155
+ ```
156
+
157
+ ### Authentication Storage
158
+
159
+ API keys for custom verified providers are stored in **both locations** for redundancy:
160
+
161
+ ```json
162
+ // Primary storage: ~/.local/share/opencode/auth.json
163
+ {
164
+ "zai-code-anth": {
165
+ "type": "api",
166
+ "key": "user-api-key-here"
167
+ }
168
+ }
169
+
170
+ // Backup storage: ~/.config/ai-speedometer/ai-benchmark-config.json
171
+ {
172
+ "verifiedProviders": {
173
+ "zai-code-anth": "user-api-key-here"
174
+ }
175
+ }
176
+ ```
177
+
178
+ ```json
179
+ {
180
+ "zai-code-anth": {
181
+ "type": "api",
182
+ "key": "user-api-key-here"
183
+ },
184
+ "nanogpt-plan": {
185
+ "type": "api",
186
+ "key": "another-api-key"
187
+ }
188
+ }
189
+ ```
190
+
191
+ ## Adding New Custom Verified Providers
192
+
193
+ ### Step-by-Step Process
194
+
195
+ 1. **Research the Provider**
196
+ - Determine the provider type (OpenAI-compatible, Anthropic, Google)
197
+ - Find the base API endpoint URL
198
+ - Identify available models and their API IDs
199
+
200
+ 2. **Create Provider Configuration**
201
+ ```json
202
+ {
203
+ "id": "unique-provider-id",
204
+ "name": "Human Readable Name",
205
+ "baseUrl": "https://api.provider.com/v1",
206
+ "type": "openai-compatible",
207
+ "models": {
208
+ "model-key-1": {
209
+ "id": "actual-model-id-1",
210
+ "name": "Model 1 Display Name"
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ 3. **Add to custom-verified-providers.json**
217
+ - Add your provider configuration to the file
218
+ - Ensure the provider ID is unique
219
+ - Test the configuration
220
+
221
+ 4. **Test the Provider**
222
+ ```bash
223
+ # Start CLI
224
+ ai-speedometer
225
+
226
+ # Add your API key for the new provider
227
+ # Select "Set Model" → "Add Verified Provider"
228
+ # Choose your new provider from the list
229
+ ```
230
+
231
+ ### Validation Checklist
232
+
233
+ Before adding a new provider, verify:
234
+
235
+ - [ ] **Base URL Accessibility**: The endpoint is reachable and responds to HTTPS requests
236
+ - [ ] **Authentication**: The correct authentication method is configured
237
+ - [ ] **Model Availability**: Models exist and are accessible with the API
238
+ - [ ] **Rate Limits**: Provider allows reasonable request rates for benchmarking
239
+ - [ ] **API Compatibility**: Endpoint follows the expected SDK format
240
+
241
+ ### Best Practices
242
+
243
+ 1. **Provider ID Naming**
244
+ - Use lowercase letters, numbers, and hyphens
245
+ - Make it descriptive and unique
246
+ - Example: `my-provider-name` not `MyProviderName`
247
+
248
+ 2. **Model Naming**
249
+ - Use clear, human-readable names
250
+ - Include provider context if helpful
251
+ - Example: `GPT-4 via MyProvider` not just `GPT-4`
252
+
253
+ 3. **Base URL Configuration**
254
+ - Include the full API path
255
+ - Use HTTPS only
256
+ - Ensure trailing slash consistency
257
+
258
+ 4. **Type Selection**
259
+ - Choose the most specific type available
260
+ - When in doubt, use `openai-compatible`
261
+ - Test with the actual SDK if possible
262
+
263
+ ## Configuration Options Reference
264
+
265
+ ### Provider Fields
266
+
267
+ | Field | Required | Type | Description |
268
+ |-------|----------|------|-------------|
269
+ | `id` | Yes | String | Unique identifier for the provider |
270
+ | `name` | Yes | String | Display name shown in the CLI |
271
+ | `baseUrl` | Yes | String | API endpoint URL |
272
+ | `type` | Yes | String | Provider type (SDK to use) |
273
+ | `models` | Yes | Object | Models available for this provider |
274
+
275
+ ### Model Fields
276
+
277
+ | Field | Required | Type | Description |
278
+ |-------|----------|------|-------------|
279
+ | `id` | Yes | String | API model identifier |
280
+ | `name` | Yes | String | Display name for the model |
281
+
282
+ ### Supported Provider Types
283
+
284
+ #### openai-compatible
285
+ - **SDK**: `@ai-sdk/openai-compatible`
286
+ - **Authentication**: Bearer token in Authorization header
287
+ - **Base URL Format**: `https://api.example.com/v1`
288
+ - **Model Format**: Standard OpenAI model IDs
289
+ - **Examples**: Groq, Together AI, Fireworks AI
290
+
291
+ #### anthropic
292
+ - **SDK**: `@ai-sdk/anthropic`
293
+ - **Authentication**: x-api-key and x-api-version headers
294
+ - **Base URL Format**: `https://api.anthropic.com`
295
+ - **Model Format**: Claude model IDs (claude-3-sonnet-20240229, etc.)
296
+ - **Examples**: Anthropic Claude API, Anthropic-compatible endpoints
297
+
298
+ #### google
299
+ - **SDK**: `@ai-sdk/google`
300
+ - **Authentication**: x-goog-api-key header
301
+ - **Base URL Format**: `https://generativelanguage.googleapis.com`
302
+ - **Model Format**: Gemini model IDs (gemini-pro, etc.)
303
+ - **Examples**: Google Gemini API
304
+
305
+ ## Troubleshooting
306
+
307
+ ### Common Issues
308
+
309
+ #### 1. Provider Not Showing in List
310
+ **Symptoms**: Custom verified provider doesn't appear in provider selection
311
+
312
+ **Solutions**:
313
+ - Check JSON syntax in `custom-verified-providers.json`
314
+ - Verify provider ID is unique
315
+ - Ensure file is in the correct project root directory
316
+ - Restart the CLI application
317
+
318
+ #### 2. Authentication Failures
319
+ **Symptoms**: API key accepted but models fail during benchmark
320
+
321
+ **Solutions**:
322
+ - Verify the provider type matches the actual API
323
+ - Check base URL format and trailing slashes
324
+ - Confirm API key has correct permissions
325
+ - Test API endpoint manually with curl
326
+
327
+ #### 3. Model Not Found Errors
328
+ **Symptoms**: Selected model returns "not found" from provider
329
+
330
+ **Solutions**:
331
+ - Verify model ID matches provider's API exactly
332
+ - Check model availability in your account/region
333
+ - Ensure model object key is different from model ID
334
+ - Test with a simple curl request
335
+
336
+ ### Debugging Commands
337
+
338
+ ```bash
339
+ # Check custom verified providers configuration
340
+ cat custom-verified-providers.json
341
+
342
+ # Validate JSON syntax
343
+ python -m json.tool custom-verified-providers.json > /dev/null
344
+
345
+ # Test API endpoint accessibility
346
+ curl -I https://api.provider.com/v1/models
347
+
348
+ # Check authentication storage
349
+ cat ~/.config/ai-speedometer/ai-benchmark-config.json
350
+
351
+ # Run CLI in debug mode
352
+ ai-speedometer --debug
353
+ ```
354
+
355
+ ### Testing New Providers
356
+
357
+ Before adding to the main configuration:
358
+
359
+ 1. **Manual API Test**
360
+ ```bash
361
+ curl -H "Authorization: Bearer YOUR_KEY" \
362
+ https://api.provider.com/v1/models
363
+ ```
364
+
365
+ 2. **Single Model Test**
366
+ ```bash
367
+ curl -H "Authorization: Bearer YOUR_KEY" \
368
+ -H "Content-Type: application/json" \
369
+ -d '{"model": "model-id", "messages": [{"role": "user", "content": "Hello"}]}' \
370
+ https://api.provider.com/v1/chat/completions
371
+ ```
372
+
373
+ 3. **CLI Integration Test**
374
+ - Add provider temporarily to local config
375
+ - Test through CLI interface
376
+ - Verify benchmark results
377
+
378
+ ## Security Considerations
379
+
380
+ ### API Key Management
381
+ - Custom verified providers never store API keys in the main configuration
382
+ - Keys are stored in user-specific config files with proper permissions
383
+ - No API keys are logged or transmitted to external services
384
+
385
+ ### Provider Vetting
386
+ - Only add providers from trusted sources
387
+ - Verify provider privacy policies and data handling practices
388
+ - Ensure providers follow security best practices
389
+ - Regularly review provider configurations for updates
390
+
391
+ ### Network Security
392
+ - All providers must use HTTPS endpoints
393
+ - Certificate validation is enforced
394
+ - No plaintext authentication is supported
395
+ - API keys are transmitted only via headers
396
+
397
+ ## Migration and Updates
398
+
399
+ ### Adding New Providers
400
+ 1. **Test in Development**: Verify provider works locally
401
+ 2. **Update Configuration**: Add to `custom-verified-providers.json`
402
+ 3. **Update Documentation**: Document any special requirements
403
+ 4. **Communicate Changes**: Inform users of new provider options
404
+
405
+ ### Removing Providers
406
+ 1. **Deprecation Period**: Keep provider for at least one release cycle
407
+ 2. **User Communication**: Announce removal in advance
408
+ 3. **Migration Support**: Help users migrate to alternatives
409
+ 4. **Clean Removal**: Remove from configuration and documentation
410
+
411
+ ### Configuration Updates
412
+ - When provider APIs change, update the configuration
413
+ - Maintain backward compatibility when possible
414
+ - Document breaking changes clearly
415
+ - Test updates thoroughly before deployment
416
+
417
+ ## Contributing
418
+
419
+ ### Adding New Providers
420
+ To contribute a new custom verified provider:
421
+
422
+ 1. **Research**: Thoroughly test the provider's API
423
+ 2. **Documentation**: Include any special setup requirements
424
+ 3. **Testing**: Verify the provider works with the CLI
425
+ 4. **Pull Request**: Submit the configuration change
426
+
427
+ ### Provider Requirements
428
+ - Must be a reliable AI service provider
429
+ - Should have reasonable API rate limits
430
+ - Must support standard AI SDK patterns
431
+ - Should provide documentation for their API
432
+ - Must be accessible via HTTPS
433
+
434
+ ### Code of Conduct
435
+ - Only add providers that you personally use and recommend
436
+ - Ensure providers have clear privacy policies
437
+ - Avoid providers with known security issues
438
+ - Respect provider terms of service
439
+
440
+ ## Future Enhancements
441
+
442
+ ### Planned Features
443
+ 1. **Provider Validation**: Automatic testing of provider configurations
444
+ 2. **Version Management**: Support for multiple provider API versions
445
+ 3. **Dynamic Loading**: Load providers from external sources
446
+ 4. **Provider Metrics**: Performance and reliability tracking
447
+ 5. **User Feedback**: Allow users to rate and review providers
448
+
449
+ ### Configuration Improvements
450
+ 1. **Schema Validation**: JSON schema validation for configurations
451
+ 2. **Default Values**: Support for optional configuration fields
452
+ 3. **Environment Variables**: Override configurations via environment
453
+ 4. **Conditional Models**: Model availability based on user account
454
+
455
+ ### Integration Enhancements
456
+ 1. **Auto-discovery**: Automatically detect provider capabilities
457
+ 2. **Webhooks**: Real-time provider status updates
458
+ 3. **Health Checks**: Monitor provider availability
459
+ 4. **Failover**: Automatic fallback to alternative providers
460
+
461
+ ---
462
+
463
+ This guide provides comprehensive documentation for custom verified providers in the AI Speedometer system. For additional questions or to contribute new providers, please refer to the main project documentation or create an issue on the GitHub repository.
@@ -12,6 +12,8 @@ Models.dev is a centralized registry of AI model providers and their models. It
12
12
  - **Model Catalogs:** Available models for each provider with their names and IDs
13
13
  - **Provider Classification:** Categorization by provider type (OpenAI-compatible, Anthropic, Google, etc.)
14
14
 
15
+ **Note:** For information about custom verified providers (pre-configured providers not in models.dev), see [Custom Verified Providers](custom-verified-providers.md).
16
+
15
17
  ## Integration Architecture
16
18
 
17
19
  ### Core Components
@@ -70,7 +72,7 @@ User Request → CLI → getAllProviders() → Models.dev API → Provider Data
70
72
 
71
73
  ### 2. Dual Provider System Flow
72
74
 
73
- The system now manages two distinct provider types:
75
+ The system now manages three distinct provider types:
74
76
 
75
77
  #### Verified Providers (models.dev integration)
76
78
  ```
@@ -84,6 +86,18 @@ Provider Selection → API Key Input → auth.json Storage → Provider Activati
84
86
  3. **Secure Storage:** Key is stored in `~/.local/share/opencode/auth.json`
85
87
  4. **Provider Activation:** Provider becomes available in model selection
86
88
 
89
+ #### Custom Verified Providers (pre-configured)
90
+ ```
91
+ Pre-configured Definition → custom-verified-providers.json → API Key Input → Integration
92
+ ```
93
+
94
+ **Custom Verified Provider Process:**
95
+
96
+ 1. **Pre-configured Definition:** Providers defined in `custom-verified-providers.json`
97
+ 2. **API Key Input:** User enters API key for the pre-configured provider
98
+ 3. **Authentication Storage:** Key stored in auth.json alongside verified providers
99
+ 4. **Integration:** Available immediately in model selection interface
100
+
87
101
  #### Custom Providers (user-defined)
88
102
  ```
89
103
  Custom Provider Setup → ai-benchmark-config.json Storage → Direct Integration
@@ -105,9 +119,10 @@ Verified Providers → Custom Providers → Combine → Present to User
105
119
  **Model Assembly Process:**
106
120
 
107
121
  1. **Verified Models:** Load models from authenticated providers in auth.json
108
- 2. **Custom Models:** Load user-defined models from ai-benchmark-config.json
109
- 3. **Deduplication:** Ensure no duplicate models in final list
110
- 4. **Presentation:** Display combined list in model selection interface
122
+ 2. **Custom Verified Models:** Load models from custom-verified-providers.json with API keys
123
+ 3. **Custom Models:** Load user-defined models from ai-benchmark-config.json
124
+ 4. **Deduplication:** Ensure no duplicate models in final list
125
+ 5. **Presentation:** Display combined list in model selection interface
111
126
 
112
127
  ## Configuration Files and Locations
113
128
 
@@ -121,6 +136,10 @@ Verified Providers → Custom Providers → Combine → Present to User
121
136
  - **ai-benchmark-config.json:** `~/.config/ai-speedometer/ai-benchmark-config.json` (custom providers)
122
137
  - **Cache:** `~/.cache/ai-speedometer/models.json` (models.dev API cache)
123
138
 
139
+ #### Custom Verified Providers
140
+ - **custom-verified-providers.json:** `./custom-verified-providers.json` (pre-configured provider definitions)
141
+ - **Authentication:** Same as verified providers (stored in auth.json)
142
+
124
143
  ### Configuration Structures
125
144
 
126
145
  #### Verified Providers (auth.json)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-speedometer",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A comprehensive CLI tool for benchmarking AI models across multiple providers with parallel execution and professional metrics",
5
5
  "main": "cli.js",
6
6
  "bin": {