|
26 | 26 | - Use `export interface` for API types, `export const Schema = z.object()` for validation |
27 | 27 | - Prefix unused variables with underscore or use `_` for ignored parameters |
28 | 28 | - Handle undefined values explicitly in comparisons and sorting |
29 | | -- Use optional chaining (`?.`) and nullish coalescing (`??`) for safe property access |
| 29 | +- Use optional chaining (`?.`) and nullish coalescing (`??`) for safe property access |
| 30 | + |
| 31 | +## Model Configuration |
| 32 | + |
| 33 | +### Multi-Provider Model Distribution |
| 34 | +- Same model appears in 3+ separate provider directories with **no cross-referencing** |
| 35 | +- Each provider maintains independent TOML files with provider-specific IDs |
| 36 | +- Example: Claude Opus 4.6 exists in `anthropic/`, `amazon-bedrock/`, `google-vertex-anthropic/`, `cloudflare-ai-gateway/` |
| 37 | +- Content (capabilities, pricing) is manually duplicated - no shared source |
| 38 | + |
| 39 | +### Model ID = Filename |
| 40 | +- The `id` field is **auto-injected** by `generate.ts` from the filename (minus `.toml`) |
| 41 | +- Never include `id:` in TOML files - it's derived from the file path |
| 42 | +- Filename `anthropic.claude-opus-4-6-v1.toml` → ID `anthropic.claude-opus-4-6-v1` |
| 43 | + |
| 44 | +### Bedrock Naming Patterns |
| 45 | +- Most dated models use `-v1:0` suffix: `anthropic.claude-3-5-sonnet-20241022-v1:0.toml` |
| 46 | +- **Latest/undated models use bare `-v1`**: `anthropic.claude-opus-4-6-v1.toml` (no `:0`) |
| 47 | +- Legacy models also use bare version: `anthropic.claude-instant-v1.toml`, `anthropic.claude-v2.toml` |
| 48 | +- Region prefixes: `us.`, `eu.`, `global.` (default has no prefix) |
| 49 | + |
| 50 | +### Vertex AI Naming Patterns |
| 51 | +- Dated models use `@YYYYMMDD`: `claude-opus-4-5@20251101.toml` |
| 52 | +- **Latest/undated models use bare name**: `claude-opus-4-6.toml` (no `@` suffix) |
| 53 | +- Pattern: filename without `@` means it's the current/latest version |
| 54 | + |
| 55 | +### Cost Schema |
| 56 | +- `cost.context_over_200k` is a nested `Cost` object for >200K token pricing |
| 57 | +- Cache pricing ratios: standard models use 10%/125% (read/write), regional variants may use 30%/375% |
| 58 | +- Always validate with `bun validate` - schema uses `.strict()` so extra fields cause errors |
| 59 | + |
| 60 | +### Required vs Optional Fields |
| 61 | +| Field | Required? | Notes | |
| 62 | +|-------|-----------|-------| |
| 63 | +| `name`, `release_date`, `last_updated` | Yes | Human-readable metadata | |
| 64 | +| `attachment`, `reasoning`, `tool_call`, `open_weights` | Yes | Boolean capabilities | |
| 65 | +| `cost`, `limit`, `modalities` | Yes | Objects with their own required fields | |
| 66 | +| `family`, `knowledge`, `temperature`, `structured_output` | No | Optional metadata | |
| 67 | +| `status` | No | Use for `"alpha"`, `"beta"`, `"deprecated"` lifecycle | |
0 commit comments