Repository navigation
feat(prompts): a model can say which prompt file it wants - #4
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
promptfield on a model and routes every system prompt lookup throughModel::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.mdcoversorca-v4-pro. A provider that routes by its own scheme sells the same model asacme-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 testpasses. The field is documented in README.md.