█████████████████████████████████████████████████████████
████ ▄▄▄▄▄ █ ▀▀▄ ▄█ ▄█▄▀▄▄▀ ▀ █▄█▄▀▀▀▀▀█▄▀▀ █ ▄▄▄▄▄ ████
████ █ █ █▄ █▀█ ▄▄██▄▄ ▄▀ ▄▄▄ ▄██▀█ ▀▀█ ▄█ █ █ ████
████ █▄▄▄█ █▀▀▄█ ▀ ▄ ▄▀▀█ ▄▄▄ ▀▀▀██ ▀▀▄▄▄▀███ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ █ █▄█▄█▄█ █ █ █▄█ ▀ █▄█▄▀▄▀ ▀ ▀▄█▄▄▄▄▄▄▄████
████▀█ ▀▄▀▄ █▀▀▄▄▀▄▀ ▄ ▄▄▄ ▄ █▄▀▄▄█▀ ▄█▄▄▄ ▄██ ▄▄████
████▄▀▀▀ ▀▄▀█ ▄ █ ▀█▄ █ ▀▀▀▀▀▄█▀▄ ▀ █ █▄ ▀▄ ▀▀▀ ▄█▄████
████▄▀ ▄ ▄▄▀▄▀▄█▀███ ▀▄▄████▄ █▄▄▄▀▄█ ▄▀█ ▄▄▀ ▀▄ ▄█████
█████ ▄▀██▄ ▄█ ██▄▄ ▀▄ ▀██▀ ▀▄▄▀ ▄▀▄ ▀▄▀ █▀█ ▄ ▄ ████
████ █ ▀▄▄██▄▄█ ▀▀▀ ▀██▄▄▄▄█ ▄██▀█ █▄ ▀ ▀█▄ ▀ ▀▄▄████
████▄▀▀ ██▄█ ▄█ ▀ █▄█▀▄█ ▄ ▀▀▀▀ ▄█ ▄█▄█▀▀▀█▄ ▄██▄████
████▀██▄ ▄▄█ █▀▀▄▄ ▀█▀▀▄ █▀▀ █ ▀ ██▄█▄██▄▄▄▄▄▀ ▄██ █▄████
████▄▀ ▄ ▄▄▄ ▄ ▄▄▄█▄▄▄▄▀▀█ ▄▄▄ █▄▀▀ ▄▄▄█▄█▄ ▄▄▄ ▄▄▄▄████
████▄▄▀▄ █▄█ ▀ █▄▄▀▀ ▀▄▀█ █▄█ ▄▄ ▀█ █ ██ █▄█ ▄▄ ████
████ ▄ ▄▄▄ █▄▀ ▄▄█▀▀▄█▀▄▄ ▄ ▄▀█▀ █▀█ █▄▀ ▄▄ ▄ ▄███ ████
████▄▀▄▄ ▄▄▀▀▀▀ ██ █▀▄▀▀ ▀▀▀▀▄█ ▄ ███ ▄▀█ ▀▀▀▄ ▄▄████
████▄▄ ▀█▄▀ █ ▄ ▀▄█▀ ▀ ▄▄ ▄▄▄▀▄█ ▄▄ ▄ █▄▄▀█▄▀ ▀▄ ▄████
████ █▀▄ ▄█▀▀██▄ ▀▄ █▀█▀ ▀▀████▄▄ ██▄███▄ ▀▄▀▄█ ▄█████
████ ▀▄██▄▄█▄▀█▀█ ▄█ ██▄▀▀█▄▄ █▄█ ▄ ▄█ █ █▄▄▄██ ████
████ ▄▀ █▄ ▀ █▄██▀ ▀ █▀▀▀▀█▀ █▄▄▄▀▀█ ▄█▄ █▄▄▄▀▄▀█████
█████ ▀▀█▄▄▄ █ █▀▀█ ▄▀ ▀▀▀▀▄▄▄█▀█▄ ▄▄██▄█▄▀▄█▄▀█ ▄████
████▄▄▄███▄▄ █ ▀ █▀▄▀▀▀ ▄▄▄ █▄▄ ▀▀██▄▄█▄ ▄▄▄ ██▄█████
████ ▄▄▄▄▄ ██▄▀██ ▄███ ▀▄ █▄█ ▀ ▄▄█▀▀▀▄▄ ▀▀ █▄█ ▄█ ████
████ █ █ █ ▄█▀▄▀▀▀▄▄█ ▀ ▄▄ ▄█ ▀█ █▄█ ▄ ▄ ▄ ▄▄ ▀▄▄ ████
████ █▄▄▄█ █▄█▄▄▄▄▄▄▄▀▀ ▀▀ █ █▀▄██▀▀▄▄█▀ ▀ ▀▄██▄▄ ████
████▄▄▄▄▄▄▄██▄███▄▄▄██▄█▄█▄██▄▄▄▄████▄█▄▄█▄█▄██▄▄▄▄▄▄████
llm is Simon Willison's command line LLM clientexport OPEN_API_KEY=...
uvx llm -m gpt-4.1-nano 'What is 2 + 2?'
This is useful for quick help without leaving the terminal.
You can install plugins...
pip install llm
llm install llm-openrouter llm-gemini llm-anthropic
... and use other models.
export OPENROUTER_API_KEY=...
llm models # list models
llm -m openrouter/deepseek/deepseek-r1:free 'What is 2 + 2?'
llm '10th prime number' \
--system 'Write Python code in ```python...```' \
| tee >(cat >&2) \
| awk '/^```/{X=!X; next} X' \
| python -
You do need to be careful. But where's the fun in that? 😀
pyrun() {
llm "$*" \
--model gpt-4.1-mini \
--system 'Write CONCISE Python code inside ```python...```
Begin with inline script dependencies.
# /// script
# requires-python = ">=3.13"
# dependencies = ["pandas", ...]
# ///
import pandas as pd
...
' \
| tee >(cat >&2) \
| awk '/^```/{X=!X; next} X' \
| uv run -
}
pyrun Generate fake student data. Save as JSON and CSV
pyrun Create 5 images with random shapes and colors. Save as test-1.png, ...
pyrun Create cities.geojson with markers on the 10 most populated cities
pyrun Convert all CSV files in this folder into parquet
pyrun Randomly add a few missing cells to all CSVs
pyrun Create _cleaned.csv versions of all CSVs dropping missing values
pyrun Deduplicate any '*name*' column in all CSVs with fuzzywuzzy ratio of 90+
pyrun Show me the Wikipedia home page as Markdown
pyrun Format README.md as Markdown and print using rich
pyrun Download the iris dataset, train a logistic regression classifier, and print the accuracy
pyrun Download the Singapore shapefile from gadm and tell me the bounding box
pyrun Find duplicate images in ./photos via perceptual hashing (imagehash) and output a CSV of dup clusters
pyrun "From vega_datasets flights_2k data, save daily flight count as a line chart flights.png"
pyrun Render cities.geojson as an interactive Folium map with circle markers sized by population as cities.html
pyrun Scrape the top 20 HN front-page links with BeautifulSoup and save as hn.json
pyrun Fetch all headings from https://docs.python.org/3/library/index.html and save to python_stdlib_headings.txt
pyrun Using Playwright, save a screenshot of https://example.com as example.png
pyrun 'Rename "Wealth Report-0786-mmm-yy.pdf" where mmm is like Jan, Feb, ... and yy is like 24, 25, ... to 20yy-mm.pdf like 2024-01.pdf, 2024-02.pdf, etc. and run it'
pyrun 'Load gen-ai-messages.json with Pandas, get time from .time (yyyy-mm-ddThh:mm:ss.xxxZ format) and print the number of rows by month as a table'
To initialize this slide deck, use slide.py
uv run slide.py llm-cli.md
To go to the next slide:
uv run slide.py