llm templates listing should surface pinned model, schema and tools
Please describe. Thanks for the fast merge on the pipx link fix the other week. This one is a feature suggestion that came out of actually living with a growing
llm templatescollection.
llm templates shows the name and the prompt/system text, and that is it. Templates can now pin a lot more than that: model: (from --model at save time), schema_object: (from --schema), tools:/functions:, options:, and the extract: settings. None of that is visible from the listing, so answering a simple question like "which of my templates pin gpt-4o?" or "which ones need tools?" means running llm templates show on each one.
It gets more annoying after a plugin upgrade: the templates that pin a specific model are exactly the ones most likely to need attention, and there is no way to spot them from the list.
Describe the solution you'd like
A compact suffix of markers on each line of the llm templates output, for example:
cmd : system: reply with macos terminal commands only, no extra information
dog : prompt: invent a dog [schema]
report : system: Write a QA report [model: gpt-4o] [tools: llm_time, search]Markers only appear when the corresponding field is set, so existing listings look unchanged for simple prompt-only templates. The fields I would surface, in the order that seems most useful:
[model: <model id>]whentemplate.modelis set[schema]whenschema_objectis set[tools: <n>or the names]whentoolsis set- maybe
[fragments: <n>]for fragments, though that is more debatable
The template object is already fully loaded in templates_list() in llm/cli.py, so this is a pure display change, no new loading. The Template fields are all there in llm/templates.py.
Describe alternatives you've considered
- A
--verboseflag for the extra info. I think the one-line markers are small enough to just always show, but a flag is fine too. - A separate
llm templates --jsonfor scripting. Separate idea, could be its own issue.
I searched the tracker first: #44 added system prompts to this listing back in the day, but I did not find a prior discussion of surfacing model/schema/tools. Happy to open a PR for the marker version if you think the shape is right.
Source: simonw/llm