LLM Call
Call your own LLM APIs from Claude Code for tasks that don't need Opus.
First-time Setup
On first use, run the interactive init to configure providers:
python scripts/init.py
This creates ~/.config/llm-call/config.json with API endpoints and keys.
To view or export config:
python scripts/init.py --show # Show config (keys masked)
python scripts/init.py --env # Print env export commands
python scripts/init.py --add qwen # Add single provider
Usage
Single call
# Direct question
python scripts/llm_call.py "What is RAG?"
# Translate a file (auto-detects file path)
python scripts/llm_call.py --task translate article.md
# Specify provider
python scripts/llm_call.py -p qwen --task summarize article.md
# Custom system prompt + file input
python scripts/llm_call.py -s "You are a translator" -f article.md "Translate to Chinese"
# Stream output
python scripts/llm_call.py --stream "Explain transformers"
# Write to file
python scripts/llm_call.py --task translate article.md -o translated.md
# Pipe input
cat article.md | python scripts/llm_call.py --task summarize
Batch processing
python scripts/llm_call.py --task translate --batch "articles/*.md" -o ./output/
Help
python scripts/llm_call.py --list-providers
python scripts/llm_call.py --list-tasks
Environment Variables
Provider config via env vars (overrides config.json):
| Variable | Description |
|---|---|
LLM_<PROVIDER>_BASE_URL |
API base URL |
LLM_<PROVIDER>_API_KEY |
API key |
LLM_<PROVIDER>_MODEL |
Default model |
LLM_DEFAULT_PROVIDER |
Default provider name |
Example: LLM_DEEPSEEK_BASE_URL=http://server:5001/v1
Preset Tasks
See references/tasks.md for detailed templates.
| Task | Description |
|---|---|
translate |
EN -> CN, preserve Markdown |
translate-en |
CN -> EN |
summarize |
Structured summary |
polish |
Chinese text polishing |
explain |
Simple explanation for beginners |