Pyhton API for models list
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 10
Description
The CLI command for listing models calls the models_list() function as a decorated function.
https://github.com/simonw/llm/blob/bf229945fe57036fa75e8105e59d9e506a720156/llm/cli.py#L783-L787
Is it possible to "un-decorate" that function so that the following call can be used in code:
from llm.cli import models_list
models_list()
In a Jupyter notebook / IPython context, running the above causes an error.
Alternatively, could the function be split out into its own function and then wrapped separately in the CLI?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with llm/cli.py lines 783-787 and inspect how the models_list() function is decorated for the CLI. Verify the chosen separation or wrapper allows from llm.cli import models_list; models_list() to run in a Jupyter or IPython context while preserving the CLI listing command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100