- Review the project documentation (
AGENTS.md) to understand:- Commands for validation (
bun validate) - Code style guidelines (Bun with TypeScript ESM modules, Zod schemas, etc.)
- Architecture (monorepo with
packages/directory, TOML config files inproviders/)
- Commands for validation (
- Examine existing provider configurations in the
providers/directory to understand the structure - Study existing model configurations to understand the required fields and format
- Create a new directory in
providers/with the provider name - Create a
provider.tomlfile with the following required fields:name = "Provider Name" env = ["API_KEY_ENV_VAR"] npm = "@ai-sdk/package-name" api = "https://api.provider.com/v1" doc = "https://docs.provider.com/api" - Ensure the provider configuration follows the schema defined in
packages/core/src/schema.ts
- Determine the appropriate subdirectory for the model within the provider's
models/directory (usually based on the model's organization) - Create a new TOML file for the model with the following required fields:
name = "Model Name" release_date = "YYYY-MM-DD" last_updated = "YYYY-MM-DD" attachment = true/false reasoning = true/false temperature = true/false tool_call = true/false open_weights = true/false [limit] context = 131072 output = 131072 [modalities] input = ["text"] output = ["text"] - Optional fields include:
knowledge = "YYYY-MM" [cost] input = 0.00 output = 0.00
- Run
bun validateto check that all configurations are valid according to the schema - Address any validation errors that appear
- Ensure the validation command completes with exit code 0
- Obtain API credentials for the provider
- Use
curlor another HTTP client to verify that the model is available through the provider's API - Check that the model details (pricing, context limits, etc.) match what you've configured
- Create a new feature branch for your changes:
git checkout -b feature/add-provider-model-name - Add and commit your changes with a conventional commit message:
git add providers/provider-name/ git commit -m "feat: add Model Name to Provider Name provider - Create TOML configuration for model-name model - Include proper pricing, context limits, and modality settings - Validate configuration with bun validate command - Verify model availability through provider API"
This workflow ensures that new providers and models are properly configured, validated, and integrated into the platform following all established conventions and best practices.