CLI Usage
llms.py provides a powerful command-line interface for interacting with LLMs.
Basic Usage
Section titled “Basic Usage”Simple Queries
Section titled “Simple Queries”# Ask a questionllms "What is the capital of France?"
# Multi-line promptllms "Explain quantum computingin simple terms"Specify Model
Section titled “Specify Model”Use specific model
llms -m gemini-2.5-pro "Write a Python function to sort a list"llms -m grok-4 "Explain this code with humor"llms -m qwen3-max "Translate this to Chinese"System Prompts
Section titled “System Prompts”Add system prompt
llms -s "You're a helpful coding assistant" "Reverse a string in Python?"Combine with model selection
llms -m claude-sonnet-4-0 -s "You are a quantum computing expert" \ "Explain quantum entanglement"Multi-Modal Inputs
Section titled “Multi-Modal Inputs”Images
Section titled “Images”# Analyze imagellms --image photo.jpg "What's in this image?"
# Remote imagellms --image https://example.com/photo.png "Describe this photo"
# With specific modelllms -m qwen2.5vl --image screenshot.png "Extract text from this image"
# Combined with system promptllms -s "You are a data analyst" --image chart.png "What trends do you see?"# Transcribe audiollms --audio recording.mp3 "Transcribe this audio"
# Summarize audiollms --audio meeting.wav "Summarize this meeting"
# With specific modelllms -m gpt-4o-audio-preview --audio interview.mp3 "Extract main topics"Files (PDFs)
Section titled “Files (PDFs)”# Summarize documentllms --file report.pdf "Summarize this document"
# Extract informationllms --file policy.pdf "What are the key changes?"
# With specific modelllms -m gpt-5 --file handbook.pdf "List all policies"Custom Templates
Section titled “Custom Templates”Using Chat Templates
Section titled “Using Chat Templates”# Load request from JSON filellms --chat request.json
# Override user messagellms --chat request.json "New user message"
# Override modelllms -m kimi-k2 --chat request.json
# With imagellms --chat image-request.json --image photo.jpg
# With audiollms --chat audio-request.json --audio talk.mp3Example Template
Section titled “Example Template”{ "model": "kimi-k2", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": ""} ], "temperature": 0.7, "max_tokens": 150}Advanced Options
Section titled “Advanced Options”Custom Parameters
Section titled “Custom Parameters”# Set temperature and seedllms --args "temperature=0.7&seed=111" "What is 2+2?"
# Multiple parametersllms --args "temperature=0.5&max_completion_tokens=50" "Tell me a joke"
# Stop sequencesllms --args "stop=Two,Words" "Count to 5"
# Combine with other optionsllms -m grok-4 --args "temperature=0.3" "Hello"Parameter Types
Section titled “Parameter Types”- Floats:
temperature=0.7,frequency_penalty=0.2 - Integers:
max_completion_tokens=100 - Booleans:
store=true,logprobs=true - Strings:
stop=one - Lists:
stop=two,words
Common Parameters
Section titled “Common Parameters”temperature: Controls randomness (0.0 to 2.0)max_completion_tokens: Maximum tokens in responseseed: For reproducible outputstop_p: Nucleus sampling parameterfrequency_penalty: Penalize new tokens based on frequencypresence_penalty: Penalize new tokens based on presencereasoning_effort: Reasoning effort (low, medium, high)
Raw Output
Section titled “Raw Output”# Display full JSON responsellms --raw "What is 2+2?"Verbose Logging
Section titled “Verbose Logging”# Enable detailed loggingllms --verbose "Tell me a joke"
# Custom log prefixllms --verbose --logprefix "[DEBUG] " "Hello world"Configuration Management
Section titled “Configuration Management”List Providers and Models
Section titled “List Providers and Models”# List all enabled providers and modelsllms --listllms ls
# List specific providersllms ls ollamallms ls google anthropicEnable/Disable Providers
Section titled “Enable/Disable Providers”# Enable providersllms --enable openrouterllms --enable anthropic google_free groq
# Disable providersllms --disable ollamallms --disable openai anthropicSet Default Model
Section titled “Set Default Model”# Set default modelllms --default grok-4
# Verifyllms "Hello" # Uses grok-4Check Providers
Section titled “Check Providers”# Check all models for a providerllms --check groq
# Check specific modelsllms --check groq kimi-k2 llama4:400b gpt-oss:120bThis tests:
- Provider reachability
- API key validity
- Response times
- Model availability
Custom Config File
Section titled “Custom Config File”# Use custom configllms --config /path/to/config.json "Hello"Initialize Config
Section titled “Initialize Config”# Create default configllms --initOutput Formatting
Section titled “Output Formatting”Pipe to Markdown Renderer
Section titled “Pipe to Markdown Renderer”# Beautiful terminal output with glowllms "Explain quantum computing" | glowSave to File
Section titled “Save to File”# Save response to filellms "Write a Python script" > script.py
# Append to filellms "Add error handling" >> script.pyExamples
Section titled “Examples”Code Generation
Section titled “Code Generation”llms -m claude-sonnet-4-0 "Python function to calculate fibonacci numbers"Translation
Section titled “Translation”llms -m qwen3-max "Translate 'Hello, how are you?' to Chinese"Data Analysis
Section titled “Data Analysis”llms -m gemini-2.5-pro --image chart.png "Analyze this sales chart"Document Summarization
Section titled “Document Summarization”llms -m gpt-5 --file report.pdf "Provide a 3-paragraph summary"Audio Transcription
Section titled “Audio Transcription”llms -m gpt-4o-audio-preview --audio meeting.mp3 "Transcribe and summarize"Next Steps
Section titled “Next Steps”- Image Support - Use images with vision models
- Audio Support - Process audio files
- File Support - Work with PDFs and documents
- Server Mode - Run as API server
- Configuration - Customize settings