Installation
Installation
Section titled “Installation”Install LM Deluge using pip (Python 3.10+):
python -m pip install -U lm-delugeOptional extras:
pip install plyvelif you want LevelDB-backed local cachingpip install pdf2image pillowif you plan to turn PDFs into images viaImage.from_pdfnpm install -g just-bashif you wantJustBashSandboxfor cross-platform sandboxed bash tools
API Keys
Section titled “API Keys”LM Deluge reads API keys from environment variables so the client can contact each provider directly. Populate the process environment before constructing clients and pass those values down to your workers, CLI scripts, or notebook kernels.
Required Environment Variables
Section titled “Required Environment Variables”Depending on which providers you plan to use, set the appropriate API keys:
# OpenAIOPENAI_API_KEY=sk-...
# AnthropicANTHROPIC_API_KEY=sk-ant-...
# Google AI Studio (Gemini)GEMINI_API_KEY=...
# CohereCOHERE_API_KEY=...
# OpenRouter (any model prefixed with openrouter:)OPENROUTER_API_KEY=...
# Meta, Groq, DeepSeek, etc. use provider-specific keys defined in src/lm_deluge/models
# AWS Bedrock (for Amazon-hosted Anthropic and Meta models)AWS_ACCESS_KEY_ID=...AWS_SECRET_ACCESS_KEY=...Local Environment
Section titled “Local Environment”Set the variables in your shell, process manager, or secret manager before running your application:
export OPENAI_API_KEY=sk-...export ANTHROPIC_API_KEY=sk-ant-...export GEMINI_API_KEY=...If your application wants .env behavior for local development, install and invoke a loader in your application entrypoint before importing or using LM Deluge.
Verification
Section titled “Verification”Verify your installation by running a simple test:
from lm_deluge import LLMClient
client = LLMClient("gpt-4.1-mini")responses = client.process_prompts_sync(["Say hello!"])print(responses[0].completion)If you see a response from the model, you’re all set!
Skill for AI Coding Assistants
Section titled “Skill for AI Coding Assistants”If you use AI coding assistants like Claude Code or Codex, you can install the lm-deluge skill to give them instant familiarity with the library:
# Install to default location (~/.claude/skills)deluge skill install
# Or specify a custom directorydeluge skill install ~/.codex/skillsThis installs a SKILL.md file that teaches your coding assistant how to use lm-deluge correctly—including the right imports, common patterns, and API gotchas—so it can help you write code that works on the first try.
Next Steps
Section titled “Next Steps”Head over to the Quick Start guide to learn how to use LM Deluge effectively.