Skip to content

feat(prompts): a model can say which prompt file it wants - #4

Merged
klNuno merged 1 commit into
mainfrom
fix/prompt-name
Aug 9, 2026
Merged

klNuno merged 1 commit into
mainfrom
fix/prompt-name

Conversation

@klNuno

@klNuno klNuno commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Adds an optional prompt field on a model and routes every system prompt lookup through Model::prompt_name, so a model can name the file it wants when its id cannot.

Prompt files are matched by name and a stem may be a prefix of an id, so orca-v4.md covers orca-v4-pro. A provider that routes by its own scheme sells the same model as acme-orca-v4-pro, nothing matches, and the failure is silent: a file that matches nothing is simply never offered.

The field names the model rather than trimming the id. Which part of an arbitrary id belongs to the endpoint is a fact only whoever wrote the config holds, so a trimming rule would work until two endpoints disagreed about where the model name starts.

cargo test passes. The field is documented in README.md.

Files are matched to a model by name, and a stem may be a prefix of the id, so
`orca-v4.md` covers `orca-v4-pro`. An endpoint that routes by its own scheme
breaks that: it sells the same model as `acme-orca-v4-pro`, nothing matches, and
the failure is silent because a file that matches nothing is simply not offered.

`prompt` on the model is the fix, and it is deliberately not a trimming rule.
Which part of an arbitrary id belongs to the endpoint is a fact only whoever
wrote the config knows, and guessing it would work until the day two endpoints
disagree about where the model name starts.

Every lookup goes through `Model::prompt_name` so the four call sites cannot
drift apart.
@klNuno
klNuno merged commit 1dbe834 into main Aug 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant