Skip to content

Commit ddb3a0f

Browse files
committed
update agents.md
1 parent 96c1204 commit ddb3a0f

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,27 @@
3131
## Model Configuration
3232

3333
- Model `id` is **auto-injected** from filename (minus `.toml`) — never put `id` in TOML files
34-
- Same model is duplicated across provider directories with no cross-referencing
34+
- Models may reuse another model's definition via `extends` (see below); otherwise the full definition must be present in the file
3535
- Schema uses `.strict()` — extra fields cause validation errors
3636

37+
### `[extends]` (inheritance between models)
38+
- Syntax — a table at the top of the TOML:
39+
```toml
40+
[extends]
41+
from = "<provider-id>/<model-id>" # required
42+
omit = ["experimental.modes.fast"] # optional, dot-path strings
43+
```
44+
Example: `from = "anthropic/claude-opus-4-6"`
45+
- Resolved at parse time in `generate()`; the final JSON output contains **no** `extends` field — it exists only to cut duplication in the TOMLs
46+
- Merge semantics:
47+
- Plain objects (`[cost]`, `[limit]`, `[modalities]`, `[provider]`, `[experimental]`, …) are **deep-merged**
48+
- Arrays (e.g. `modalities.input`) and primitives are **replaced** wholesale by the child
49+
- Any field the child omits is inherited verbatim from the base
50+
- `omit` runs **after** the merge and deletes each dot-path from the result (used when the child needs to *remove* something the base defines, e.g. a provider-specific experimental mode). Every listed path must exist in the merged model, else an error is thrown. Ancestor tables that become empty as a result are also pruned, so `omit = ["experimental.modes.fast"]` yields no `experimental` key in the final JSON when `fast` was the only mode.
51+
- Chains are allowed (A extends B extends C); cycles throw
52+
- The base model must exist; `[extends.from]` pointing at a missing provider/model is an error
53+
- The `extends` table is stripped before schema validation, so the merged result must still satisfy the strict `Model` schema
54+
3755
### Bedrock Naming Patterns
3856
- Dated models: `-v1:0` suffix (`anthropic.claude-3-5-sonnet-20241022-v1:0.toml`)
3957
- Latest/undated models: bare `-v1` (`anthropic.claude-opus-4-6-v1.toml`)

0 commit comments

Comments
 (0)