Introduce the concept of an LLM environment

Open
#212 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
ai, cli

Research direction

Start by tracing how the CLI uses the user_dir at ~/Library/Application Support/io.datasette.llm and how Python library users access the same settings. Define the environment's handling of default models, aliases, and plugin model storage, including whether plugin storage is shared. Done means the CLI and independently instantiated library environments have clear, documented storage behavior.

Written by the indexing model from the issue text.

Description

design enhancement

LLM currently keeps a bunch of its settings in that user_dir - on macOS that's ~/Library/Application Support/io.datasette.llm

This makes sense for a CLI tool, but it doesn't make sense when LLM is being used as a Python library independently of the CLI.

I'm going to introduce the concept of an "environment". The CLI tool will use an environment that stores things in that folder, but Python library users will have the option to instantiate an environment of their own that's not tied to that folder.

Things an environment needs to be able to handle:

  • What default models have been set?
  • What aliases are configured?
  • The tricky bit: what folder should plugins etc store their models in?

That last one is difficult because it actually does make sense for plugins to share model storage between the CLI tool and the Python library usage.

Need to think about this a bit more.

Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
6d 12h
Merged PRs (30d)
15

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.

More from simonw/llm

All issues in simonw/llm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.