Durable-LLM Command Line Interface (CLI)
Documents the `dllm` CLI commands for running prompts, chatting, and listing models across LLM providers.
What this file does
Documents the dllm CLI commands for running prompts, chatting, and listing models across LLM providers.
When to use it
- You want to run one-off prompts from the terminal without writing code
- You need an interactive chat session with a specific model like GPT-4 or Claude
- You want to list available models or their options
- You are building a tool that wraps Durable-LLM's CLI
Assumes this stack
Durable-LLM Command Line Interface (CLI)
Durable-LLM provides a command-line interface (CLI) for interacting with various Large Language Model providers. This document outlines the available commands and their usage.
Installation
Ensure you have installed the Durable-LLM gem:
gem install durable-llm
Commands
prompt
Run a single prompt and get a response.
dllm prompt [OPTIONS] PROMPT
Options:
-m, --model MODEL: Specify the model to use (default: gpt-3.5-turbo)-s, --system SYSTEM_PROMPT: Set a system prompt-c, --continue: Continue the previous conversation--cid CONVERSATION_ID: Continue a specific conversation by ID--no-stream: Disable streaming of tokens-o, --option KEY:VALUE: Set model-specific options
Example:
dllm prompt -m gpt-4 "What is the capital of France?"
chat
Start an interactive chat session.
dllm chat [OPTIONS]
Options:
-m, --model MODEL: Specify the model to use (default: gpt-3.5-turbo)-s, --system SYSTEM_PROMPT: Set a system prompt-c, --continue: Continue the previous conversation--cid CONVERSATION_ID: Continue a specific conversation by ID-o, --option KEY:VALUE: Set model-specific options
Example:
dllm chat -m claude-3-opus-20240229
models
List available models.
dllm models [OPTIONS]
Options:
--options: Show model options
Example:
dllm models
Configuration
The CLI uses the same configuration as the Durable-LLM library. You can set up your API keys and other settings using environment variables or a configuration file.
Environment variables:
DLLM__OPENAI__API_KEY: OpenAI API keyDLLM__ANTHROPIC__API_KEY: Anthropic API key- (Add other provider API keys as needed)
Alternatively, you can use the configuration file located at ~/.config/io.datasette.llm/keys.json for compatibility with the llm tool.
Examples
-
Run a simple prompt:
dllm prompt "Tell me a joke" -
Start an interactive chat with a specific model:
dllm chat -m gpt-4 -
List available models:
dllm models -
Run a prompt with a system message and custom options:
dllm prompt -s "You are a helpful assistant" -o temperature:0.7 "Explain quantum computing"
Remember to set up your API keys before using the CLI. Enjoy using Durable-LLM from the command line!
What's inside
3 command sections (prompt, chat, models), configuration details, and 4 examples
Change this for your project
- Replace
gpt-3.5-turbowith your default model if different - Replace
~/.config/io.datasette.llm/keys.jsonwith your own config path - Replace
dllmwith your own CLI command name if you fork the gem
Where it goes
Use as the system prompt for your model call, or as the base instructions in your agent framework.
Related Documents
Character Persona
Defines a Fallout 2 roleplay persona for an LLM agent: charming rogue with social-first combat and moral code.
How to implement tool use
Explains how to define, configure, and control tool use with the Anthropic API, including model selection, tool definitions, output control, and parallel calls.
Gemini by Example
Collects 20+ Gemini API code examples covering text, images, audio, video, PDFs, agents, and token counting.
Claude Tool Use (Function Calling) Documentation
Teaches how to define and use Claude tool use (function calling) with Python, including schema rules, execution patterns, and best practices.