Back to .md Directory

Durable-LLM Command Line Interface (CLI)

Documents the `dllm` CLI commands for running prompts, chatting, and listing models across LLM providers.

May 2, 2026
0 downloads
0 views
ai llm prompt claude openai
View source

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

RubyDurable-LLMOpenAIAnthropic

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 key
  • DLLM__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

  1. Run a simple prompt:

    dllm prompt "Tell me a joke"
    
  2. Start an interactive chat with a specific model:

    dllm chat -m gpt-4
    
  3. List available models:

    dllm models
    
  4. 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-turbo with your default model if different
  • Replace ~/.config/io.datasette.llm/keys.json with your own config path
  • Replace dllm with 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