# LLM Call

> Call external LLM APIs (DeepSeek, Qwen, OpenAI-compatible) from Claude Code without consuming Opus tokens. Use when user says: "use DeepSeek to translate", "summarize with a cheap model", "batch translate files", "use qwen to polish", or any request to call their own model APIs for translation, summarization, polishing, or explanation tasks. Also triggers on first use for interactive setup.

- Skill: `dimthink/llm-call` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add dimthink/llm-call`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dimthink/llm-call/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: dimthink (https://skillmd.com/u/dimthink)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/dimthink/llm-call

---


# 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:

```bash
python scripts/init.py
```

This creates `~/.config/llm-call/config.json` with API endpoints and keys.
To view or export config:

```bash
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

```bash
# 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

```bash
python scripts/llm_call.py --task translate --batch "articles/*.md" -o ./output/
```

### Help

```bash
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](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 |

