simonw / simonw/llm

Pyhton API for models list

Open
#303 0 comments 0 reactions 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.