HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
simonw
llm
Python2023–2026
simonw / llm

llm

Access large language models from the command-line

53Distinct people
78Mentions
0Explicit recommenders
12.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Access large language models from the command-line

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year78 dated mentions

Observed mentions: 2023-05-19 00:35:03 UTC to 2026-08-05 02:35:12 UTC.

0102030402023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 12 mentions; 1 submissions, 11 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 22 mentions; 3 submissions, 19 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 39 mentions; 3 submissions, 36 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC12111
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC22319
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC39336
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC514

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
LLM A CLI tool and Python library for interacting with OpenAI, Anthropic’s Claude, Google’s Gemini, Qwen, Gemma, Kimi, DeepSeek, Mistral, and dozens of other Large Language Models, both via remote APIs and with models that can be installed and run on your own machine. Watch Language models on the command-line on YouTube for a demo or read the accompanying detailed notes. With LLM you can: Run prompts from the command-line Store prompts and responses in SQLite Generate and store embeddings Extract structured content from text and images Grant models the ability to execute tools … and much, much more Quick start First, install LLM using pip or Homebrew or pipx or uv: pip install llm Or with Homebrew (see warning note): brew install llm Or with pipx: pipx install llm Or with uv uv tool install llm Use LLM to run prompts or start chats against an arbitrary OpenAI-compatible Chat Completions endpoint, such as LM Studio. With uvx, you can do this without installing LLM first: uvx llm openai endpoint http://localhost:1234/v1 \ -m google/gemma-4-12b \ "What is the capital of France?" uvx llm openai endpoint http://localhost:1234/v1 \ -m google/gemma-4-12b \ --chat Add --key your-api-key if the endpoint requires authentication. See Run against an endpoint without configuring it for more options. If you have an OpenAI API key key you can run this: # Paste your OpenAI API key into this llm keys set openai # Run a prompt (with the default gpt-6-luna model) llm "Ten fun names for a pet pelican" # Extract text from an image llm "extract text" -a scanned-document.jpg # Use a system prompt against a file cat myfile.py | llm -s "Explain this code" Run prompts against Gemini or Anthropic with their respective plugins: llm install llm-gemini llm keys set gemini # Paste Gemini API key here llm -m gemini-3.5-flash 'Tell me fun facts about Mountain View' llm install llm-anthropic llm keys set anthropic # Paste Anthropic API key here llm -m claude-sonnet-5 'Impress me with wild facts about turnips' You can also install a plugin to access models that can run on your local device. If you use Ollama: # Install the plugin llm install llm-ollama # Download and run a prompt against the Orca Mini 7B model ollama pull llama3.2:latest llm -m llama3.2:latest 'What is the capital of France?' To start an interactive chat with a model, use llm chat: llm chat -m gpt-4.1 Chatting with gpt-4.1 Type 'exit' or 'quit' to exit Type '!multi' to enter multiple lines, then '!end' to finish Type '!edit' to open your default editor and modify the prompt. Type '!fragment <my_fragment> [<another_fragment> ...]' to insert one or more fragments > Tell me a joke about a pelican Why don't pelicans like to tip waiters? Because they always have a big bill! Project news 29th April 2026: LLM 0.32a0 is a major backwards-compatible refactor 11th August 2025: LLM 0.27, the annotated release notes: GPT-5 and improved tool calling 27th May 2025: Large Language Models can run tools in your terminal with LLM 0.26 5th May 2025: Feed a video to a vision LLM as a sequence of JPEG frames on the CLI (also LLM 0.25) 7th April 2025: Long context support in LLM 0.24 using fragments and template plugins 28th February 2025: Structured data extraction from unstructured content using LLM schemas 17th February 2025: LLM 0.22, the annotated release notes 29th October 2024: You can now run prompts against images, audio and video in your terminal using LLM 26th January 2024: LLM 0.13: The annotated release notes 12th September 2023: Build an image search engine with llm-clip, chat with models with llm chat 4th September 2023: LLM now provides tools for working with embeddings 12th July 2023: The LLM CLI tool now supports self-hosted language models via plugins 18th May 2023: llm, ttok and strip-tags—CLI tools for working with ChatGPT and other LLMs 4th April 2023: The original announcement of the llm CLI tool For everything else, see the llm tag on my blog. Contents Setup Installation Upgrading to the latest version Using uvx A note about Homebrew and PyTorch Installing plugins API key management Saving and using stored keys Passing keys using the –key option Keys in environment variables Configuration Setting a custom default model Setting a custom directory location Turning SQLite logging on and off Usage Executing a prompt Model options Attachments System prompts Tools Extracting fenced code blocks JSON output Schemas Fragments Continuing a conversation Tips for using LLM with Bash or Zsh Completion prompts Starting an interactive chat Listing available models Setting default options for models OpenAI models Configuration OpenAI language models Model features Web Search Code Interpreter Fast mode and service tiers OpenAI embedding models OpenAI completion models Adding more OpenAI models Other models Installing and using a local model OpenAI-compatible models Run against an endpoint without configuring it Configure an OpenAI-compatible model Extra HTTP headers Tools How tools work Trying out tools LLM’s implementation of tools Default tools Tips for implementing tools Schemas Schemas tutorial Getting started with dogs Extracting people from a news articles Using JSON schemas Ways to specify a schema Concise LLM schema syntax Saving reusable schemas in templates Browsing logged JSON objects created using schemas Templates Getting started with –save Using a template Listing available templates Templates as YAML files System prompts Fragments Options Tools Schemas Additional template variables Specifying default parameters Configuring code extraction Setting a default model for a template Template loaders from plugins Fragments Using fragments in a prompt Using fragments in chat Browsing fragments Setting aliases for fragments Viewing fragments in your logs Using fragments from plugins Listing available fragment prefixes Model aliases Listing aliases Adding a new alias Removing an alias V
Read the full README on GitHub

What Hacker News says

78 sources
tgalal·Jan 21, 2026Submission

Show HN: GenAI Prompts as "Native" Programs

Lately I've seen several projects for templating and executing prompts. However they all go along the lines of $ executor prompt_file_or_name which didn't exactly fit my "taste". I figured one could use the same trick like busybox, where you can detect if your binary is being executed via a different name (symlink). The symlink name is treated as the promptname, and arguments are generated from a schema defined in the prompt template. So now instead of: # Using https://github.com/chr15m/runprompt echo '{"words": 300, "text": "some long text"}' | ./runprompt summarize.prompt # Or using https://github.com/simonw/llm echo "some long text" | llm -t summarize -p words 300 You get: echo "some long text" | summarize --words 300 And of course with documented arguments and so on: summarize --help Usage: summarize [OPTIONS] --
Read the rest
words <words> --text <text> Prompt inputs: --words <words> Maximum number of words --text <text> The text to summarize, defaults to stdin That was the starting point, then things escalated and suddenly there is load balancing, caching, execution via shebang and other (IMO) neat features :). Happy to get feedback and ideas. Github: https://github.com/tgalal/promptcmd/ Documentation: https://docs.promptcmd.sh/ Examples: https://promptcmd.sh/lib/
1 points · Open discussion
When I'm writing a script that requires some kind of call to an LLM, I use this: https://github.com/simonw/llm. This is of course cross-platform and works with both models accessible through an API and local ones. I'm afraid this might not solve your problem though, as this is not an out of the box solution, it requires the user to either provide their own API key or to install Ollama and wire it up on their own.
In Ask HN: What's a standard way for apps to request text completion as a service?
I shipped a new release yesterday - https://llm.datasette.io/en/stable/changelog.html#v0-28 but yeah, the last core release before that was in August. I've been pushing out plugin releases for it though, for new models from Gemini and Anthropic and others. Honestly the main problem has been that LLM's unique selling point back in 2024 was that it was the only tool taking CLI access to LLMs seriously. In 2025 Claude Code and Codex CLI etc all came along and suddenly there's not much unique about having a CLI tool for LLMs any more! There's also a major redesign needed to the database storage and model abstraction layer in order to handle reasoning traces and more complex tool call patterns. I opened an issue about that here - it's something I'm stewing on but will take quite some work to get right: https://github.com/simonw/llm/issues/1314
Read the rest
I've been spending more of my time focusing on other projects which make use of LLM, in particular Datasette plugins that use the asyncio Python library: https://llm.datasette.io/en/stable/python-api.html#async-mod... I expect those to drive some core improvements pretty soon.
In OpenAI are quietly adopting skills, now available in ChatGPT and Codex CLI
This is the script that uses yt-dlp to print the English transcript. I pipe it to Simon Willison's `llm` tool. https://gist.github.com/abdusco/118a6a3ab41a0a1d2a5f8813f789... https://github.com/simonw/llm > youtube_transcript.py 'https://www.youtube.com/watch?v=DAX2_mPr9W8' | llm 'give me keypoints, ignore promotions' Certainly! Here are the key points from the detailed discussion about dishwasher detergents, washing cycles, and hot water use: 1. **Dishwasher Detergent Basics:** - Most dishwashers have a detergent dispenser designed to release detergent in two doses: a smaller pre-wash dose and a larger main wash dose. - The pre-wash helps remove easily dissolvable food residues before the main wash. - Oils and fats do not dissolve well in plain water; putting some detergent in the pre-wash water help
Read the rest
s emulsify and remove these soils early. 2. **Why Use Loose Powder Detergents:** - Loose powders allow flexible dosing: users can adjust detergent amounts based on load dirtiness. - Pre-dosed pods force a single, fixed dose which can be excessive or insufficient depending on the wash. - The dispenser’s design supports splitting detergent dosing; powders are better aligned with this system than pods. ... you get the point
In I was right about dishwasher pods and now I can prove it [video]
Two years ago I wrote an agent in 25 lines of PHP [0]. It was surprisingly effective, even back then before tool calling was a thing and you had to coax the LLM into returning structured output. I think it even worked with GPT-3.5 for trivial things. In my mind LLMs are just UNIX strong manipulation tools like `sed` or `awk`: you give them an input and command and they give you an output. This is especially true if you use something like `llm` [1]. It then seems logical that you can compose calls to LLMs, loop and branch and combine them with other functions. [0] https://github.com/dave1010/hubcap [1] https://github.com/simonw/llm
In You should write an agent
Your notes on 4.5 were very interesting, but you asked it a question that only you/someone who already knows the code could ask. I don't though, so I asked it at a higher level: Claude, add tree-structured conversations to https://github.com/simonw/llm. Claude responded with a whole design doc, starting with database schema change (using the same column name even!). https://claude.ai/share/f8f0d02a-3bc1-4b48-b8c7-aa75d6f55021 As I don't know your code, that design doc looks cromulent, but you'd have to read it for yourself to decided how well it did with that higher level of ask.
In Claude Sonnet 4.5
Huh. Doesn't work over here. --- SYSTEM: Got it. Those are the setup commands for Simon Willison's LLM CLI tool, which lets you interact with language models from the command line. The -e flag installs it in editable mode, and [test] pulls in the test dependencies. Are you running into any issues with the installation or tests? What are you working on with the LLM library? USER: Correct. You run them using your code tooling. SYSTEM: Realized inability to execute requested Python commands.The user is telling me to run these commands using my code tooling. They want me to actually execute this. Let me think about what tools I have available: I have the repl tool which runs JavaScript code in a browser environment I have artifacts for creating code/documents I have web_search and web_fetch The user wants me to: Checkout https://github.com/si
Read the rest
monw/llm Run pip install -e '.[test]' Run pytest But I don't have a tool that can: Clone git repositories Run shell commands like pip or pytest Execute Python code in a command-line environment The repl tool is JavaScript-only and runs in a browser environment, not a server environment where I could run shell commands. I should clarify that I don't have the capability to run shell commands, install Python packages, or execute pytest. I can only run JavaScript code in a browser environment via the analysis tool. I need to be direct and clear about this limitation, following the user's preferences to eliminate filler and be straightforward.I don't have tooling that can run shell commands, clone git repos, install Python packages, or execute pytest. My only code execution environment is a JavaScript browser REPL. I can't run pip, pytest, or any command-line tools. I can only execute JavaScript code in a sandboxed browser environment. What were you hoping to accomplish? Do you need help understanding the test setup, or were you expecting different capabilities?R
In Claude Sonnet 4.5
I had access to a preview over the weekend, I published some notes here: https://simonwillison.net/2025/Sep/29/claude-sonnet-4-5/ It's very good - I think probably a tiny bit better than GPT-5-Codex, based on vibes more than a comprehensive comparison (there are plenty of benchmarks out there that attempt to be more methodical than vibes). It particularly shines when you try it on https://claude.ai/ using its brand new Python/Node.js code interpreter mode. Try this prompt and see what happens: Checkout https://github.com/simonw/llm and run the tests with pip install -e '.[test]' pytest I then had it iterate on a pretty complex database refactoring task, described in my post.
In Claude Sonnet 4.5

Showing the 15 most recent of 78 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.