Skip to content

Commit d4f99d9

Browse files
committed
docs: update OpenRouter documentation to reflect native embedding support and clarify plugin configurations
1 parent a4ad95d commit d4f99d9

4 files changed

Lines changed: 46 additions & 44 deletions

File tree

plugin-registry/knowledge/contextual-embeddings.mdx

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,17 @@ GOOGLE_API_KEY=your-key # If using Google
7777
**Important**: Embeddings always use the model configured in `useModel(TEXT_EMBEDDING)` from your agent setup. Do NOT try to mix different embedding models - all your documents must use the same embedding model for consistency.
7878
</Warning>
7979

80-
### Recommended Setup: OpenRouter with Separate Embedding Provider
80+
### OpenRouter Standalone Setup
8181

82-
Since OpenRouter doesn't support embeddings, you need a separate embedding provider:
82+
OpenRouter now supports embeddings natively with multiple models (`text-embedding-3-large`, `qwen3-embedding`, `gemini-embedding`, `mistral-embed`):
8383

8484
<Tabs>
85-
<Tab title="OpenRouter + OpenAI">
85+
<Tab title="OpenRouter Only">
8686
```typescript title="character.ts"
8787
export const character = {
8888
name: 'MyAgent',
8989
plugins: [
90-
'@elizaos/plugin-openrouter', // For text generation
91-
'@elizaos/plugin-openai', // For embeddings
90+
'@elizaos/plugin-openrouter', // Handles both text and embeddings
9291
'@elizaos/plugin-knowledge', // Knowledge plugin
9392
],
9493
};
@@ -98,22 +97,18 @@ Since OpenRouter doesn't support embeddings, you need a separate embedding provi
9897
# Enable contextual embeddings
9998
CTX_KNOWLEDGE_ENABLED=true
10099
101-
# Text generation (for context enrichment)
102-
TEXT_PROVIDER=openrouter
103-
TEXT_MODEL=anthropic/claude-3-haiku
100+
# OpenRouter handles both text generation and embeddings
104101
OPENROUTER_API_KEY=your-openrouter-key
105-
106-
# Embeddings (automatically used)
107-
OPENAI_API_KEY=your-openai-key
102+
OPENROUTER_EMBEDDING_MODEL=openai/text-embedding-3-large # Optional
108103
```
109104
</Tab>
110-
<Tab title="OpenRouter + Google">
105+
<Tab title="OpenRouter + Local Fallback">
111106
```typescript title="character.ts"
112107
export const character = {
113108
name: 'MyAgent',
114109
plugins: [
115-
'@elizaos/plugin-openrouter', // For text generation
116-
'@elizaos/plugin-google', // For embeddings
110+
'@elizaos/plugin-openrouter', // Cloud text & embeddings
111+
'@elizaos/plugin-ollama', // Offline fallback
117112
'@elizaos/plugin-knowledge', // Knowledge plugin
118113
],
119114
};
@@ -123,13 +118,11 @@ Since OpenRouter doesn't support embeddings, you need a separate embedding provi
123118
# Enable contextual embeddings
124119
CTX_KNOWLEDGE_ENABLED=true
125120
126-
# Text generation (for context enrichment)
127-
TEXT_PROVIDER=openrouter
128-
TEXT_MODEL=anthropic/claude-3-haiku
121+
# OpenRouter for cloud
129122
OPENROUTER_API_KEY=your-openrouter-key
130123
131-
# Embeddings (Google will be used automatically)
132-
GOOGLE_API_KEY=your-google-key
124+
# Ollama as fallback for offline use
125+
OLLAMA_API_ENDPOINT=http://localhost:11434/api
133126
```
134127
</Tab>
135128
</Tabs>

plugin-registry/knowledge/quick-start.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ export const character = {
166166
name: 'MyAgent',
167167
plugins: [
168168
'@elizaos/plugin-openrouter',
169-
'@elizaos/plugin-openai', // ← Make sure you have this as openrouter doesn't support embeddings
170169
'@elizaos/plugin-knowledge', // ← Add this line
171170
// ... your other plugins
172171
],
@@ -176,11 +175,11 @@ export const character = {
176175

177176
```env title=".env"
178177
OPENROUTER_API_KEY=your-openrouter-api-key
179-
OPENAI_API_KEY=your-openai-api-key
178+
OPENROUTER_EMBEDDING_MODEL=openai/text-embedding-3-large # Optional: specify embedding model
180179
```
181180

182181
<Note>
183-
The plugin automatically uses OpenAI embeddings even when using OpenRouter for text generation.
182+
OpenRouter now supports embeddings natively with multiple models: `text-embedding-3-large`, `qwen3-embedding`, `gemini-embedding`, `mistral-embed`.
184183
</Note>
185184

186185
## <Icon icon="question" /> FAQ

plugin-registry/llm.mdx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ Not all LLM plugins support all model types. Here's what each can do:
3131
| Anthropic |||||
3232
| Google GenAI |||||
3333
| Ollama |||||
34-
| OpenRouter || |||
34+
| OpenRouter || |||
3535

3636
**Key Points:**
37-
- 🌟 **OpenAI & Google GenAI** = Do everything (jack of all trades)
38-
- 💬 **Anthropic & OpenRouter** = Amazing at chat, need help with embeddings
37+
- 🌟 **OpenAI, Google GenAI & OpenRouter** = Do everything (jack of all trades)
38+
- 💬 **Anthropic** = Amazing at chat, needs a fallback for embeddings
3939
- 🏠 **Ollama** = Your local hero - does almost everything, no internet needed!
4040

4141
## Plugin Loading Order
@@ -49,9 +49,9 @@ plugins: [
4949

5050
// Text-only plugins (no embedding support)
5151
...(process.env.ANTHROPIC_API_KEY?.trim() ? ['@elizaos/plugin-anthropic'] : []),
52-
...(process.env.OPENROUTER_API_KEY?.trim() ? ['@elizaos/plugin-openrouter'] : []),
5352

54-
// Embedding-capable plugins (optional, based on available credentials)
53+
// Embedding-capable plugins
54+
...(process.env.OPENROUTER_API_KEY?.trim() ? ['@elizaos/plugin-openrouter'] : []),
5555
...(process.env.OPENAI_API_KEY?.trim() ? ['@elizaos/plugin-openai'] : []),
5656
...(process.env.GOOGLE_GENERATIVE_AI_API_KEY?.trim() ? ['@elizaos/plugin-google-genai'] : []),
5757

@@ -64,9 +64,9 @@ plugins: [
6464

6565
Think of it like choosing team players - you pick specialists first, then all-rounders:
6666

67-
1. **Anthropic & OpenRouter go first** - They're specialists! They're great at text generation but can't do embeddings. By loading them first, they get priority for text tasks.
67+
1. **Anthropic goes first** - It's a specialist! Great at text generation but can't do embeddings. By loading it first, it gets priority for text tasks.
6868

69-
2. **OpenAI & Google GenAI come next** - These are the all-rounders! They can do everything: text generation, embeddings, and structured output. They act as fallbacks for what the specialists can't do.
69+
2. **OpenRouter, OpenAI & Google GenAI come next** - These are the all-rounders! They can do everything: text generation, embeddings, and structured output. They act as fallbacks for what Anthropic can't do (embeddings).
7070

7171
3. **Ollama comes last** - This is your local backup player! It supports almost everything (text, embeddings, objects) and runs on your computer. Perfect when cloud services aren't available.
7272

@@ -165,12 +165,21 @@ elizaOS automatically finds another plugin that CAN do embeddings!
165165
}
166166
```
167167

168-
#### OpenRouter + Local Embeddings
168+
#### OpenRouter Standalone
169+
```json
170+
{
171+
"plugins": [
172+
"@elizaos/plugin-openrouter" // Handles text and embeddings
173+
]
174+
}
175+
```
176+
177+
#### OpenRouter + Local Fallback
169178
```json
170179
{
171180
"plugins": [
172-
"@elizaos/plugin-openrouter", // Cloud text generation
173-
"@elizaos/plugin-ollama" // Local embeddings
181+
"@elizaos/plugin-openrouter", // Cloud text & embeddings
182+
"@elizaos/plugin-ollama" // Offline fallback
174183
]
175184
}
176185
```

plugin-registry/llm/openrouter.mdx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ OPENROUTER_IMAGE_MODEL=anthropic/claude-3-5-sonnet # For vision tasks
4343
{
4444
"name": "MyAgent",
4545
"plugins": [
46-
"@elizaos/plugin-openrouter",
47-
"@elizaos/plugin-ollama" // For embeddings
46+
"@elizaos/plugin-openrouter"
4847
]
4948
}
5049
```
@@ -54,20 +53,22 @@ OPENROUTER_IMAGE_MODEL=anthropic/claude-3-5-sonnet # For vision tasks
5453
| Operation | Support | Notes |
5554
|-----------|---------|-------|
5655
| TEXT_GENERATION || All available models |
57-
| EMBEDDING | | Use fallback plugin |
56+
| EMBEDDING | | Multiple embedding models available |
5857
| OBJECT_GENERATION || Model dependent |
5958

60-
## Important: Embedding Fallback
59+
## Embedding Models
6160

62-
OpenRouter doesn't provide embedding endpoints, so include a fallback:
61+
OpenRouter now provides embedding endpoints with multiple models:
6362

64-
```json
65-
{
66-
"plugins": [
67-
"@elizaos/plugin-openrouter", // Text generation
68-
"@elizaos/plugin-openai" // Embeddings
69-
]
70-
}
63+
- `text-embedding-3-large` (OpenAI via OpenRouter)
64+
- `qwen3-embedding` (Qwen)
65+
- `gemini-embedding` (Google)
66+
- `mistral-embed` (Mistral)
67+
68+
Configure embedding model:
69+
70+
```bash
71+
OPENROUTER_EMBEDDING_MODEL=openai/text-embedding-3-large
7172
```
7273

7374
## Model Configuration

0 commit comments

Comments
 (0)