1
2
Fork
You've already forked llm
0
Lightweight cli interface to interact with LLM models from your terminal.
  • Go 100%
2025年10月12日 11:15:13 +03:00
.gitignore update readme 2025年10月11日 15:21:07 +03:00
client.go update configuration to support multiple providers 2025年10月12日 11:15:13 +03:00
config.go update configuration to support multiple providers 2025年10月12日 11:15:13 +03:00
config.yaml.example update configuration to support multiple providers 2025年10月12日 11:15:13 +03:00
files.go initial commit 2025年10月11日 15:08:43 +03:00
go.mod initial commit 2025年10月11日 15:08:43 +03:00
go.sum initial commit 2025年10月11日 15:08:43 +03:00
main.go update configuration to support multiple providers 2025年10月12日 11:15:13 +03:00
README.md update configuration to support multiple providers 2025年10月12日 11:15:13 +03:00
system.go initial commit 2025年10月11日 15:08:43 +03:00

LLM CLI

A fast command-line interface for interacting with large language models. The tool supports multiple providers through OpenAI-compatible APIs, configurable system prompts, inline file inclusion, and streaming responses.

Features

  • Provider-scoped configuration with per-model aliases
  • Named system prompts with {{info}} placeholder for runtime context (date, OS, shell, etc.)
  • File and URL references via @path tokens in prompts
  • Streaming or full-response modes
  • Optional thinking/chain-of-thought display for reasoning models

Installation

  1. Go to the releases page and download the binary for your platform.
  2. Add the binary to a directory in your PATH.
  • Example for Linux/macOS: sudo mv llm /usr/local/bin
  1. Reload your shell or session to ensure the binary is available.

Build from source

  1. Clone this repository
  2. Install dependencies: go mod tidy
  3. Build the binary: go build -o llm .

Configuration

Copy config.yaml.example to config.yaml and adjust:

  • providers list with base URL, API key, and models per provider
  • default_provider and default_model to choose the defaults
    • default_model does not support aliases, you must use provider>name instead
  • Model aliases to map short names to provider>model
  • system_prompts definitions; the default is used unless -p/--prompt is set
  • Include {{info}} in a prompt to expand runtime context

Environment variables prefixed with LLM_ override config values (e.g., LLM_API_KEY).

Usage Examples

$> llm how can i list all the files in this directory sorted by size
>> gpt-oss-20b (oss):
Use `ls -lS`
$> llm summarize @README.md
>> gpt-oss-20b (oss):
**LLM CLI**
- Command‐line tool to talk to large language models via OpenAI‐compatible APIs.
- Supports multiple providers, streaming, full responses, chain‐of‐thought display.
**Features**
- Model aliases; one can be set [...continues...]
  • Use @filename or @https://url to inject contents into the prompt
  • --raw outputs responses without processing
  • --think shows the model’s thinking phase when supported

Run llm --help for the full option list.