| title |
ModelConfig |
| description |
ModelConfig Schema Reference |
| category |
ai |
| zodFile |
model-registry |
**Source:** `packages/spec/src/ai/model-registry.zod.ts`
| Property |
Type |
Required |
Description |
| id |
string |
✅ |
Unique model identifier |
| name |
string |
✅ |
Model display name |
| version |
string |
✅ |
Model version (e.g., "gpt-4-turbo-2024-04-09") |
| provider |
Enum<'openai' | 'azure_openai' | 'anthropic' | 'google' | 'cohere' | 'huggingface' | 'local' | 'custom'> |
✅ |
|
| capabilities |
object |
✅ |
|
| limits |
object |
✅ |
|
| pricing |
object |
optional |
|
| endpoint |
string |
optional |
Custom API endpoint |
| apiKey |
string |
optional |
API key or reference to secret |
| region |
string |
optional |
Deployment region (e.g., "us-east-1") |
| description |
string |
optional |
|
| tags |
string[] |
optional |
Tags for categorization |
| deprecated |
boolean |
optional |
|
| recommendedFor |
string[] |
optional |
Use case recommendations |
import { ModelConfigSchema } from '@objectstack/spec/ai';
import type { ModelConfig } from '@objectstack/spec/ai';
// Validate data
const result = ModelConfigSchema.parse(data);
// Type-safe usage
const myModelConfig: ModelConfig = {
id: 'example',
name: 'name',
version: 'example',
// ... other required fields
};