Skip to content

Commit dfd3106

Browse files
authored
Merge pull request #20 from lerim-dev/docs/api-keys-and-providers
docs: API keys, providers, and fallback configuration
2 parents 398d08e + 8e50a30 commit dfd3106

64 files changed

Lines changed: 807 additions & 6819 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ repos:
77
pass_filenames: false
88
always_run: true
99
stages: [pre-push]
10+
- repo: local
11+
hooks:
12+
- id: vulture
13+
name: vulture
14+
entry: vulture
15+
language: python
16+
additional_dependencies: [vulture>=2.14]
17+
pass_filenames: false
18+
always_run: true
19+
stages: [pre-push]

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Lerim is file-first and primitive-first.
5858
- Project memory: `<repo>/.lerim/`
5959
- Global fallback: `~/.lerim/`
6060
- Search: file-based (no index required)
61-
- Orchestration: OpenAI Agents SDK (`LerimOAIAgent`) with per-flow tools; non-OpenAI providers use `ResponsesProxy` + LiteLLM on the lead path
61+
- Orchestration: OpenAI Agents SDK (`LerimOAIAgent`) with per-flow tools; non-OpenAI providers via LiteLLM
6262
- Extraction/summarization: DSPy pipelines with transcript windowing
6363

6464
### Sync path
@@ -142,18 +142,37 @@ lerim project add . # add current project (repeat for other repos)
142142

143143
### 3. Set API keys
144144

145-
Set keys for whatever you configure under `[roles.*]`. The shipped `default.toml`
146-
often uses **OpenCode Go** for roles — in that case set `OPENCODE_API_KEY` (see
147-
[model roles](https://docs.lerim.dev/configuration/model-roles/)). If you switch
148-
to MiniMax, Z.AI, OpenRouter, etc., set the matching env vars instead.
145+
`lerim init` walks you through provider selection and saves keys to `~/.lerim/.env`.
146+
You can also create it manually:
149147

150148
```bash
151-
export OPENCODE_API_KEY="..." # when using provider opencode_go (common default)
152-
# export MINIMAX_API_KEY="..." # if roles use minimax
153-
# export ZAI_API_KEY="..." # if you add zai as fallback
149+
# ~/.lerim/.env
150+
OPENCODE_API_KEY=your-key-here
151+
# Add more keys if using multiple providers or fallbacks
154152
```
155153

156-
You only need keys for providers referenced in your `[roles.*]` config.
154+
**Supported providers:**
155+
156+
| Provider | Env var | Config `provider =` |
157+
|----------|---------|-------------------|
158+
| OpenCode Go | `OPENCODE_API_KEY` | `"opencode_go"` |
159+
| OpenRouter | `OPENROUTER_API_KEY` | `"openrouter"` |
160+
| OpenAI | `OPENAI_API_KEY` | `"openai"` |
161+
| MiniMax | `MINIMAX_API_KEY` | `"minimax"` |
162+
| Z.AI | `ZAI_API_KEY` | `"zai"` |
163+
| Anthropic | `ANTHROPIC_API_KEY` | `"anthropic"` |
164+
| Ollama (local) || `"ollama"` |
165+
166+
**Provider and fallback configuration** in `~/.lerim/config.toml`:
167+
168+
```toml
169+
[roles.lead]
170+
provider = "opencode_go" # primary provider
171+
model = "minimax-m2.5" # model name
172+
fallback_models = ["minimax:minimax-m2.5", "zai:glm-4.7"] # auto-switch on rate limits
173+
```
174+
175+
Set API keys for your primary provider and any fallbacks.
157176

158177
### 4. Start Lerim
159178

evals/README.md

Lines changed: 0 additions & 147 deletions
This file was deleted.

evals/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)