Skip to content

Commit 92eab29

Browse files
authored
Merge pull request #26 from MachineWisdomAI/docs/llm-provider-clarification
docs: clarify LLM provider support with any-llm-sdk and multi-provider extensibility
2 parents d70f2af + 03a037d commit 92eab29

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

AGENTS_SETUP_INSTRUCTIONS.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ pip install fava-trails
2020
git clone https://github.com/MachineWisdomAI/fava-trails.git && cd fava-trails && uv sync
2121
```
2222

23-
### OpenRouter API Key (for Trust Gate)
23+
### LLM Configuration (for Trust Gate)
2424

25-
The Trust Gate reviews thoughts before promotion using an LLM via [OpenRouter](https://openrouter.ai/).
25+
The Trust Gate reviews thoughts before promotion using an LLM. By default, FAVA Trails uses [OpenRouter](https://openrouter.ai/) for unified access to 100+ models.
26+
27+
**OpenRouter (default, recommended):**
2628

2729
1. Create a free account at https://openrouter.ai/
2830
2. Generate an API key at https://openrouter.ai/keys
@@ -31,6 +33,8 @@ The Trust Gate reviews thoughts before promotion using an LLM via [OpenRouter](h
3133

3234
The default model (`google/gemini-2.5-flash`) costs ~$0.001 per review.
3335

36+
**Other providers:** FAVA Trails uses [any-llm-sdk](https://github.com/marekstephens/any-llm-sdk) for unified LLM access, enabling support for additional providers (Anthropic, OpenAI, Bedrock, etc.). Configuration for provider selection will be available in future versions via `config.yaml`.
37+
3438
## Creating the Data Repo
3539

3640
The data repo is a plain git repository that the MCP server JJ-colocates on first use. It holds your organization's trail data — separate from the engine.
@@ -148,7 +152,7 @@ trails:
148152
| `push_strategy` | string | `manual` | `immediate` auto-pushes after writes; `manual` requires explicit sync |
149153
| `trust_gate` | string | `llm-oneshot` | Global trust gate policy |
150154
| `trust_gate_model` | string | `google/gemini-2.5-flash` | Model for LLM-based trust review |
151-
| `openrouter_api_key_env` | string | `OPENROUTER_API_KEY` | Env var name holding the API key |
155+
| `openrouter_api_key_env` | string | `OPENROUTER_API_KEY` | Env var name holding the API key for OpenRouter (default provider) |
152156
| `hooks` | list | `[]` | Lifecycle hook entries (see [Lifecycle Hooks](#lifecycle-hooks)) |
153157

154158
### Per-Trail Config

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ For Claude Desktop on Windows (accessing WSL):
120120
}
121121
```
122122

123-
> The Trust Gate uses [OpenRouter](https://openrouter.ai/) to review thoughts before promotion. Get a free API key at [openrouter.ai/keys](https://openrouter.ai/keys). The default model (`google/gemini-2.5-flash`) costs ~$0.001 per review.
123+
> **The Trust Gate uses LLM verification:** Thoughts are reviewed before promotion to ensure they're coherent and safe. By default, FAVA Trails uses [OpenRouter](https://openrouter.ai/) to access 100+ models from Anthropic, OpenAI, Google, Qwen, and others. Get a free API key at [openrouter.ai/keys](https://openrouter.ai/keys). The default model (`google/gemini-2.5-flash`) costs ~$0.001 per review. Multi-provider support via [any-llm-sdk](https://github.com/marekstephens/any-llm-sdk) enables switching to other providers by modifying `config.yaml`.
124124
125125
### Use it
126126

@@ -201,7 +201,9 @@ Environment variables:
201201
| `FAVA_TRAILS_DIR` | Server | Override trails directory location (absolute path) | `$FAVA_TRAILS_DATA_REPO/trails` |
202202
| `FAVA_TRAILS_SCOPE_HINT` | Server | Broad scope hint baked into tool descriptions | *(none)* |
203203
| `FAVA_TRAILS_SCOPE` | Agent | Project-specific scope from `.env` file | *(none)* |
204-
| `OPENROUTER_API_KEY` | Server | API key for Trust Gate LLM reviews ([get one](https://openrouter.ai/keys)) | *(none — required for `propose_truth`)* |
204+
| `OPENROUTER_API_KEY` | Server | API key for Trust Gate LLM reviews via [OpenRouter](https://openrouter.ai/keys) | *(none — required for `propose_truth`)* |
205+
206+
**LLM Provider:** FAVA Trails uses [any-llm-sdk](https://github.com/marekstephens/any-llm-sdk) for unified LLM access. OpenRouter is the default provider (recommended for simplicity — single API key, 100+ models). Additional providers (Anthropic, OpenAI, Bedrock, etc.) can be configured in `config.yaml` for future versions.
205207

206208
The server reads `$FAVA_TRAILS_DATA_REPO/config.yaml` for global settings. Minimal `config.yaml`:
207209

codev/resources/arch.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
### Provider Routing
66

7-
All LLM API calls route via **OpenRouter** using `any-llm-sdk`. The `provider="openrouter"`
8-
argument is passed explicitly to every `acompletion()` call. There is no direct-API path.
7+
All LLM API calls route via **OpenRouter** (default provider) using `any-llm-sdk`. The `provider="openrouter"`
8+
argument is passed explicitly to every `acompletion()` call.
9+
10+
**Multi-provider support:** any-llm-sdk enables support for additional providers (Anthropic, OpenAI, Bedrock, etc.).
11+
The current implementation hardcodes `provider="openrouter"`, but future versions will support provider selection
12+
via `config.yaml` to enable switching between providers. There is currently no direct-API path.
913

1014
```python
1115
response = await any_llm.acompletion(
@@ -57,5 +61,8 @@ client_args={"timeout": timeout} # default: 60.0 seconds
5761

5862
## Configuration (`src/fava_trails/models.py`)
5963

60-
`GlobalConfig` has a single `openrouter_api_key_env` field (default: `"OPENROUTER_API_KEY"`).
64+
`GlobalConfig` has a single `openrouter_api_key_env` field (default: `"OPENROUTER_API_KEY"`) for OpenRouter API key configuration.
65+
66+
**Future extensibility:** To support additional LLM providers, a `llm_provider` field and provider-specific configuration will be added to `GlobalConfig`. This will enable runtime provider selection via `config.yaml` while maintaining backward compatibility with existing OpenRouter setups.
67+
6168
The previous `openai_api_key_env` field was removed in Spec 17.

0 commit comments

Comments
 (0)