simonw / simonw/llm

`-r/--reuse` mode

Open
#104 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
3d 13h
Merged PRs (30d)
10

Description

When using this on the command-line it would be useful if you could opt to get a previous response for the same prompt/system/model/options - if one exists:

cat file.py | llm "explain this file" --reuse

That way you could safely run loops against larger amounts of data while avoiding paying for the same prompt twice.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the command-line entry point for llm and trace how the prompt, system, model, and options are handled. Work out how the --reuse invocation should identify a matching previous response, then exercise the shown cat file.py | llm "explain this file" --reuse workflow and verify that repeated runs avoid paying for the same prompt twice.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.