- Validate:
bun validate- Validates all provider/model configurations - Build web:
cd packages/web && bun run build- Builds the web interface - Dev server:
cd packages/web && bun run dev- Runs development server - No test framework - No dedicated test commands found
- Runtime: Bun with TypeScript ESM modules
- Imports: Use
.jsextensions for local imports (e.g.,./schema.js) - Types: Strict Zod schemas for validation, inferred types with
z.infer<typeof Schema> - Naming: camelCase for variables/functions, PascalCase for types/schemas
- Error handling: Use Zod's
safeParse()with structured error objects includingcause - Async: Use
async/await,for awaitloops for file operations - File operations: Use Bun's native APIs (
Bun.Glob,Bun.file,Bun.write)
- Monorepo: Workspace packages in
packages/(core, web, function) - Config: TOML files for providers/models in
providers/directory - Validation: Core package validates all configurations via
generate()function - Web: Static site generation with Hono server and vanilla TypeScript
- Deploy: Cloudflare Workers for function, static assets for web
- Use
export interfacefor API types,export const Schema = z.object()for validation - Prefix unused variables with underscore or use
_for ignored parameters - Handle undefined values explicitly in comparisons and sorting
- Use optional chaining (
?.) and nullish coalescing (??) for safe property access
- Model
idis auto-injected from filename (minus.toml) — never putidin TOML files - Provider models may reuse provider-agnostic facts from
models/viabase_model; otherwise the full provider model definition must be present in the file - Schema uses
.strict()— extra fields cause validation errors
- Provider-agnostic model facts live under
models/<provider>/<model>.toml - Provider TOMLs can inherit those facts with:
Example:
base_model = "<provider-id>/<model-id>" base_model_omit = ["limit.input"] # optional, dot-path strings
base_model = "anthropic/claude-opus-4-6" - Resolved at parse time in
generate(); the final provider JSON output contains nobase_modelorbase_model_omitfields - Merge semantics:
- Plain objects from metadata and provider TOML (
[limit],[modalities], …) are deep-merged - Arrays (e.g.
modalities.input) and primitives are replaced wholesale by the child - Any provider field omitted is inherited verbatim from model metadata
cost,provider,experimental,reasoning_options,interleaved, andstatusare provider-specific and must be declared in provider TOMLs when needed
- Plain objects from metadata and provider TOML (
base_model_omitruns after the merge and deletes each dot-path from the result. Missing paths are ignored. Ancestor tables that become empty as a result are also pruned.- The base model metadata file must exist;
base_modelpointing at a missingmodels/entry is an error
- Dated models:
-v1:0suffix (anthropic.claude-3-5-sonnet-20241022-v1:0.toml) - Latest/undated models: bare
-v1(anthropic.claude-opus-4-6-v1.toml) - Region prefixes:
us.,eu.,global.(default has no prefix)
- Dated models:
@YYYYMMDD(claude-opus-4-5@20251101.toml) - Latest/undated models:
@default(claude-opus-4-6@default.toml)
cost.context_over_200kis a nestedCostobject for >200K token pricing- Cache pricing ratios: standard models use 10%/125% (read/write), regional variants may use 30%/375%
| Field | Required? | Notes |
|---|---|---|
name, release_date, last_updated |
Yes | Human-readable metadata |
attachment, reasoning, tool_call, open_weights |
Yes | Boolean capabilities |
cost, limit, modalities |
Yes | Objects with their own required fields |
family, knowledge, temperature, structured_output |
No | Optional metadata |
status |
No | Use for "alpha", "beta", "deprecated" lifecycle |