# AI use cases for LLM (simonw/llm)

Repo: [simonw/llm](https://github.com/simonw/llm) | Use cases: 3 | Page: https://dedupedai.com/use-cases/simonw-llm/

LLM is a CLI tool and Python library for interacting with OpenAI, Gemini, Qwen, DeepSeek, Mistral and dozens of other large language models, through remote APIs or models installed on your own machine. It can run prompts from the command line, store prompts and responses in SQLite, generate embeddings, extract structured content, and let models execute tools.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run prompts from the command line: https://dedupedai.com/use-cases/simonw-llm/run-your-first-prompt-from-the-command-line-with-llm/
- Chat with a local model through LLM and Ollama: https://dedupedai.com/use-cases/simonw-llm/chat-with-a-local-model-through-llm-and-ollama/
- Point LLM at any OpenAI-compatible endpoint: https://dedupedai.com/use-cases/simonw-llm/point-llm-at-any-openai-compatible-endpoint/

## How to run prompts from the command line with LLM

Repo: [simonw/llm](https://github.com/simonw/llm) | Difficulty: Beginner | Time: 10 minutes | Basis: From the README

Install LLM, store a key and pipe files into a model from your shell.

**Who it is for:** A developer who wants quick model answers without leaving the terminal.

**The problem:** Opening a chat UI for every small question breaks the flow.

**The outcome:** Prompts, file input and system prompts running from one command.

### Steps

1. Install with `pip install llm`
2. Store your key with `llm keys set openai`
3. Run `llm "Ten fun names for a pet pelican"`
4. Pipe a file in with `cat myfile.py | llm -s "Explain this code"`

### Prompt to paste into your agent

```text
Using simonw/llm, install it with `pip install llm`, set my key with `llm keys set openai`, then run `cat myfile.py | llm -s "Explain this code"` on <my file>.
```

### Caveat

The README example names a default model that may change between releases.

Risk, cost: Hosted models bill per token on your own API key.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/simonw-llm/run-your-first-prompt-from-the-command-line-with-llm/

## How to chat with a local model through LLM and Ollama with LLM

Repo: [simonw/llm](https://github.com/simonw/llm) | Difficulty: Beginner | Time: 20 minutes | Basis: From the README

Install the Ollama plugin and run prompts against a model that stays on your machine.

**Who it is for:** A privacy-minded developer who wants a scriptable local model.

**The problem:** Hosted APIs send your text off the machine.

**The outcome:** A local model answering prompts from the LLM command.

### Steps

1. Install LLM with `pip install llm`
2. Install the plugin with `llm install llm-ollama`
3. Pull a model with `ollama pull llama3.2:latest`
4. Run `llm -m llama3.2:latest 'What is the capital of France?'`
5. Start an interactive session with `llm chat -m gpt-4.1` or your local model name

### Prompt to paste into your agent

```text
With simonw/llm, run `llm install llm-ollama`, `ollama pull llama3.2:latest`, then `llm -m llama3.2:latest 'What is the capital of France?'` and report the output.
```

### Caveat

Requires Ollama installed separately.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/simonw-llm/chat-with-a-local-model-through-llm-and-ollama/

## How to point LLM at any OpenAI-compatible endpoint with LLM

Repo: [simonw/llm](https://github.com/simonw/llm) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Use uvx to run prompts or chats against LM Studio or another compatible server with no setup.

**Who it is for:** A developer trying out models served by LM Studio or a similar local server.

**The problem:** Configuring each server as a model takes time.

**The outcome:** A prompt or chat answered by your endpoint without installing LLM first.

### Steps

1. Start your OpenAI-compatible server, for example LM Studio
2. Run `uvx llm openai endpoint http://localhost:1234/v1` with `-m` and your model name followed by your prompt
3. Add `--chat` for an interactive session
4. Add `--key your-api-key` if the endpoint needs authentication

### Prompt to paste into your agent

```text
Using simonw/llm via uvx, run a prompt against my endpoint <url> and model <name> with `uvx llm openai endpoint`, then start a `--chat` session.
```

### Caveat

Exact multi-line command is in the README quick start.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/simonw-llm/point-llm-at-any-openai-compatible-endpoint/
