llmterm
A minimal terminal client for OpenAI-compatible LLM servers.
llmterm is a small Python command-line application for interacting with
local or self-hosted LLM servers that expose an OpenAI-compatible API.
Features
- Interactive endpoint selection (local + hosted + custom URLs)
- Automatic model discovery
- Interactive model selection (or
--modelfor scripts) - Asynchronous streaming responses
- Conversation history (with
clearto reset) - Optional custom system prompt
- Optional Markdown conversation logging
.envsupport for API keys — keys are never stored- Small, modular implementation
Project structure
llmterm/
├── pyproject.toml
├── README.md
├── .gitignore
└── src/
└── llmterm/
├── __init__.py
├── endpoint.py
├── endpoints.py
├── main.py
└── utils.py
src/ contains only package source code. Runtime-generated files are not
stored inside the Python package.
Markdown output location
When Markdown saving is enabled, responses are stored in:
~/.llmterm/
├── config.json # custom endpoint URLs only — never API keys
└── markdown-outputs/
├── model-name-2026-08-15.md
└── another-model-2026-08-15.md
This location is independent of the directory from which llmterm is run.
Keeping generated data outside the package is important for a distributable Python package because installed package directories should not be assumed to be writable.
Installation
Using uv
Install llmterm-prasannaba as a standalone CLI tool:
uv tool install llmterm-prasannaba
Note: the distribution is suffixed because plain
llmtermis blocked on PyPI (too similar to the existingllm-termproject). The installed command and the Python import are both plainllmterm.
Run:
llmterm
Using pip
You can also install llmterm-prasannaba using pip:
python -m pip install llmterm-prasannaba
Run:
llmterm
Development
Clone the repository and enter the project directory:
git clone https://github.com/prasannaba/llmterm.git
cd llmterm
Install the development environment and dependencies:
uv sync
Run the application:
uv run llmterm
API keys: never stored
llmterm never stores API keys. Keys live in memory only for the selected session and are never written to config files, logs, or markdown output. You will see this notice at startup and before every key prompt.
Provide keys via the environment (recommended for scripts) or enter them when prompted (input is hidden):
OPENAI_API_KEY=your-key
META_API_KEY=your-key
BASETEN_API_KEY=your-key
UNSLOTH_STUDIO_API_KEY=your-key # only when your server requires auth
There is deliberately no --api-key flag: keys on the command line leak via
shell history and process listings. Use --api-key-env NAME to point at a
different variable, or --no-prompt to fail fast instead of prompting.
Custom endpoint URLs may be remembered in ~/.llmterm/config.json
({custom_endpoints: [{name, base_url, key_env}]}) — keys are never saved
there, by construction and by test.
Using llmterm installed via uv tool
uv tool install (or pip install) only installs the llmterm package —
repo files such as .env.example are not installed and won't be on disk.
That file is just a template for people running from a cloned repo. As a
tool user, provide keys any of these ways:
- Environment variables (recommended): set them in your shell so every
run picks them up, e.g.
OPENAI_API_KEY,META_API_KEY,BASETEN_API_KEY(seellmterm --show-env-templatefor the full list). - Your own
.envfile: create a file named.envin the directory from which you runllmterm— it is read from the current working directory on startup. Generate a starting point with:llmterm --show-env-template > .env
then uncomment the lines you need and fill in your keys. Do not commit this file anywhere; it holds secrets. (The template contains variable names only, no values, so saving its output is safe until you edit it.) - Enter the key when prompted: input is hidden and the key lives in memory only for that session.
Configured endpoints
| Endpoint | Base URL (overridable) | Key env |
|---|---|---|
| Llama.cpp | http://localhost:8080/v1 |
— |
| LiteRTM | http://localhost:9379/v1 |
— |
| UnSloth-Studio | http://127.0.0.1:8888/v1 |
UNSLOTH_STUDIO_API_KEY |
| LM-Studio | http://127.0.0.1:1234/v1 |
— |
| Ollama | http://localhost:11434/v1 |
— |
| OpenAI | https://api.openai.com/v1 |
OPENAI_API_KEY |
| Meta-AI | https://api.meta.ai/v1 |
META_API_KEY |
| Baseten | https://inference.baseten.co/v1 |
BASETEN_API_KEY |
| Custom | (you provide the URL) | (you provide env var) |
Local servers must be running and expose an OpenAI-compatible API. Hosted
providers (OpenAI, Meta, Baseten) expose OpenAI-compatible /v1 endpoints
(Baseten's shared inference is https://inference.baseten.co/v1, i.e. base
URL without the /chat/completions path);
override any default with --endpoint-url, LLMTERM_BASE_URL, or the
interactive Custom entry (dedicated Baseten deployments need their own URL).
Non-interactive examples:
llmterm --list-endpoints
llmterm --endpoint openai --list-models
llmterm --endpoint baseten --endpoint-url https://your-deployment.api.baseten.co/v1 --model your-model-id
llmterm --endpoint ollama --model llama3.1 --no-save --system-prompt "Be concise."
Architecture
Terminal
│
▼
llmterm
│
▼
OpenAI Python client
│
▼
OpenAI-compatible /v1 endpoint
│
▼
Local/self-hosted LLM
endpoint.py
Owns the asynchronous OpenAI-compatible client, model discovery, chat completion calls, and client cleanup.
endpoints.py
Owns the endpoint registry (local + hosted presets + custom URLs), URL validation/normalization, and URL-only persistence. Never stores keys.
main.py
Handles endpoint selection, model selection, conversation history, streaming, and API errors.
utils.py
Handles configuration, system prompts, response cleanup, and Markdown persistence.
The project intentionally avoids a large agent framework or abstraction layer.
Metadata
Release files for llmterm-prasannaba 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llmterm_prasannaba-0.2.0.tar.gz | 22.1 kB | Without provenance | Details for llmterm_prasannaba-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llmterm_prasannaba-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for llmterm_prasannaba-0.2.0-py3-none-any.whl |
Total release size: 41.6 kB
Release files / llmterm_prasannaba-0.2.0.tar.gz
| Download URL | llmterm_prasannaba-0.2.0.tar.gz |
|---|---|
| Size | 22.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c13a680fd6b20467ecb9489d19eddd6b7272471bca31e8d752db4ae8c5abfa92
|
|
BLAKE2b-256 checksum How to use checksums |
b5bde4f2a3bd1f8d67a7aaca75bcf6a4b102838b87be89a93ce4ba883f62e07e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / llmterm_prasannaba-0.2.0-py3-none-any.whl
| Download URL | llmterm_prasannaba-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09ce3586f1d9a4ce5f8d29e4d3d354a1b4870b2a6f9f3d77f360f0f2293a43a0
|
|
BLAKE2b-256 checksum How to use checksums |
2c915c8fec4b57301fc35ae2dbed87ab65e66f9923e6e4c05c5a03df47cb8517
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for llmterm-prasannaba 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.