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.
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!
Related Documents
Character Persona
**Name:** (set during character creation; must be said like it’s a brand)
DiffusionDB
annotations_creators:
coding: utf-8
from openai import OpenAI
Claude Tool Use (Function Calling) Documentation
Tool use (formerly called function calling) allows Claude to interact with external tools, APIs, and functions. Released on April 4, 2024, and made generally available on May 30, 2024, this feature enables Claude to perform actions beyond text generation.