Spaces:
Running
Running
Somrat Sorkar commited on
Commit ·
4987deb
1
Parent(s): 29d6958
Add support for multiple LLM providers (Zhipu, Moonshot, MiniMax, Mistral, Cohere, Groq, etc.)
Browse files- .env.example +29 -1
- README.md +57 -1
- start.sh +12 -0
.env.example
CHANGED
|
@@ -12,7 +12,7 @@
|
|
| 12 |
LLM_API_KEY=your_api_key_here
|
| 13 |
|
| 14 |
# [REQUIRED] LLM model to use (format: provider/model-name)
|
| 15 |
-
# Auto-detects provider from prefix
|
| 16 |
#
|
| 17 |
# Anthropic Claude:
|
| 18 |
# - anthropic/claude-opus-4-6
|
|
@@ -28,6 +28,34 @@ LLM_API_KEY=your_api_key_here
|
|
| 28 |
# - google/gemini-2.5-flash
|
| 29 |
# - google/gemini-2.0-flash
|
| 30 |
# - google/gemini-1.5-pro
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
LLM_MODEL=anthropic/claude-sonnet-4-5
|
| 32 |
|
| 33 |
# [REQUIRED] Gateway authentication token
|
|
|
|
| 12 |
LLM_API_KEY=your_api_key_here
|
| 13 |
|
| 14 |
# [REQUIRED] LLM model to use (format: provider/model-name)
|
| 15 |
+
# Auto-detects provider from prefix — any provider is supported!
|
| 16 |
#
|
| 17 |
# Anthropic Claude:
|
| 18 |
# - anthropic/claude-opus-4-6
|
|
|
|
| 28 |
# - google/gemini-2.5-flash
|
| 29 |
# - google/gemini-2.0-flash
|
| 30 |
# - google/gemini-1.5-pro
|
| 31 |
+
#
|
| 32 |
+
# Zhipu (ChatGLM) / ZAI:
|
| 33 |
+
# - zhipu/glm-4-plus
|
| 34 |
+
# - zhipu/glm-4
|
| 35 |
+
# - zai/glm-4 (alias)
|
| 36 |
+
#
|
| 37 |
+
# Moonshot (Kimi):
|
| 38 |
+
# - moonshot/moonshot-v1-128k
|
| 39 |
+
# - moonshot/moonshot-v1-32k
|
| 40 |
+
#
|
| 41 |
+
# MiniMax:
|
| 42 |
+
# - minimax/minimax-01
|
| 43 |
+
# - minimax/minimax-text-01
|
| 44 |
+
#
|
| 45 |
+
# Mistral:
|
| 46 |
+
# - mistral/mistral-large
|
| 47 |
+
# - mistral/mistral-medium
|
| 48 |
+
# - mistral/mistral-small
|
| 49 |
+
#
|
| 50 |
+
# Cohere:
|
| 51 |
+
# - cohere/command-r
|
| 52 |
+
# - cohere/command-r-plus
|
| 53 |
+
#
|
| 54 |
+
# Groq:
|
| 55 |
+
# - groq/mixtral-8x7b-32768
|
| 56 |
+
# - groq/llama2-70b-4096
|
| 57 |
+
#
|
| 58 |
+
# Or any other provider supported by OpenClaw (format: provider/model-name)
|
| 59 |
LLM_MODEL=anthropic/claude-sonnet-4-5
|
| 60 |
|
| 61 |
# [REQUIRED] Gateway authentication token
|
README.md
CHANGED
|
@@ -118,7 +118,7 @@ See **`.env.example`** for the complete reference with examples.
|
|
| 118 |
|
| 119 |
## 🤖 LLM Provider Setup
|
| 120 |
|
| 121 |
-
Just set `LLM_MODEL` with the correct provider prefix —
|
| 122 |
|
| 123 |
### Anthropic (Claude)
|
| 124 |
```
|
|
@@ -141,6 +141,62 @@ LLM_MODEL=google/gemini-2.5-flash
|
|
| 141 |
```
|
| 142 |
Models: `google/gemini-2.5-flash` · `google/gemini-2.0-flash` · `google/gemini-1.5-pro`
|
| 143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
---
|
| 145 |
|
| 146 |
## 📱 Telegram Setup
|
|
|
|
| 118 |
|
| 119 |
## 🤖 LLM Provider Setup
|
| 120 |
|
| 121 |
+
Just set `LLM_MODEL` with the correct provider prefix — **any provider is supported**! The provider is auto-detected from the model name.
|
| 122 |
|
| 123 |
### Anthropic (Claude)
|
| 124 |
```
|
|
|
|
| 141 |
```
|
| 142 |
Models: `google/gemini-2.5-flash` · `google/gemini-2.0-flash` · `google/gemini-1.5-pro`
|
| 143 |
|
| 144 |
+
### Zhipu (ChatGLM) / ZAI
|
| 145 |
+
```
|
| 146 |
+
LLM_API_KEY=your_zhipu_api_key
|
| 147 |
+
LLM_MODEL=zhipu/glm-4-plus
|
| 148 |
+
```
|
| 149 |
+
Models: `zhipu/glm-4-plus` · `zhipu/glm-4` · `zai/glm-4` (alias)
|
| 150 |
+
Get key from: [Zhipu Platform](https://open.bigmodel.cn)
|
| 151 |
+
|
| 152 |
+
### Moonshot (Kimi)
|
| 153 |
+
```
|
| 154 |
+
LLM_API_KEY=sk-...
|
| 155 |
+
LLM_MODEL=moonshot/moonshot-v1-128k
|
| 156 |
+
```
|
| 157 |
+
Models: `moonshot/moonshot-v1-128k` · `moonshot/moonshot-v1-32k`
|
| 158 |
+
Get key from: [Moonshot API](https://platform.moonshot.cn)
|
| 159 |
+
|
| 160 |
+
### MiniMax
|
| 161 |
+
```
|
| 162 |
+
LLM_API_KEY=your_minimax_api_key
|
| 163 |
+
LLM_MODEL=minimax/minimax-01
|
| 164 |
+
```
|
| 165 |
+
Models: `minimax/minimax-01` · `minimax/minimax-text-01`
|
| 166 |
+
Get key from: [MiniMax Platform](https://api.minimaxi.com)
|
| 167 |
+
|
| 168 |
+
### Mistral
|
| 169 |
+
```
|
| 170 |
+
LLM_API_KEY=your_mistral_api_key
|
| 171 |
+
LLM_MODEL=mistral/mistral-large
|
| 172 |
+
```
|
| 173 |
+
Models: `mistral/mistral-large` · `mistral/mistral-medium` · `mistral/mistral-small`
|
| 174 |
+
Get key from: [Mistral Console](https://console.mistral.ai)
|
| 175 |
+
|
| 176 |
+
### Cohere
|
| 177 |
+
```
|
| 178 |
+
LLM_API_KEY=your_cohere_api_key
|
| 179 |
+
LLM_MODEL=cohere/command-r
|
| 180 |
+
```
|
| 181 |
+
Models: `cohere/command-r` · `cohere/command-r-plus`
|
| 182 |
+
Get key from: [Cohere Dashboard](https://dashboard.cohere.com)
|
| 183 |
+
|
| 184 |
+
### Groq
|
| 185 |
+
```
|
| 186 |
+
LLM_API_KEY=your_groq_api_key
|
| 187 |
+
LLM_MODEL=groq/mixtral-8x7b-32768
|
| 188 |
+
```
|
| 189 |
+
Models: `groq/mixtral-8x7b-32768` · `groq/llama2-70b-4096`
|
| 190 |
+
Get key from: [Groq Console](https://console.groq.com)
|
| 191 |
+
|
| 192 |
+
### Any Other Provider
|
| 193 |
+
HuggingClaw supports **any LLM provider** that OpenClaw supports. Just use:
|
| 194 |
+
```
|
| 195 |
+
LLM_API_KEY=your_api_key
|
| 196 |
+
LLM_MODEL=provider/model-name
|
| 197 |
+
```
|
| 198 |
+
The provider prefix is auto-detected and mapped to the appropriate environment variable.
|
| 199 |
+
|
| 200 |
---
|
| 201 |
|
| 202 |
## 📱 Telegram Setup
|
start.sh
CHANGED
|
@@ -44,6 +44,18 @@ if [[ "$LLM_MODEL" == "google/"* ]]; then
|
|
| 44 |
export GOOGLE_API_KEY="$LLM_API_KEY"
|
| 45 |
elif [[ "$LLM_MODEL" == "openai/"* ]]; then
|
| 46 |
export OPENAI_API_KEY="$LLM_API_KEY"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
else
|
| 48 |
# Default to Anthropic for claude/* or anthropic/* models
|
| 49 |
export ANTHROPIC_API_KEY="$LLM_API_KEY"
|
|
|
|
| 44 |
export GOOGLE_API_KEY="$LLM_API_KEY"
|
| 45 |
elif [[ "$LLM_MODEL" == "openai/"* ]]; then
|
| 46 |
export OPENAI_API_KEY="$LLM_API_KEY"
|
| 47 |
+
elif [[ "$LLM_MODEL" == "zhipu/"* ]] || [[ "$LLM_MODEL" == "zai/"* ]]; then
|
| 48 |
+
export ZHIPU_API_KEY="$LLM_API_KEY"
|
| 49 |
+
elif [[ "$LLM_MODEL" == "moonshot/"* ]]; then
|
| 50 |
+
export MOONSHOT_API_KEY="$LLM_API_KEY"
|
| 51 |
+
elif [[ "$LLM_MODEL" == "minimax/"* ]]; then
|
| 52 |
+
export MINIMAX_API_KEY="$LLM_API_KEY"
|
| 53 |
+
elif [[ "$LLM_MODEL" == "mistral/"* ]]; then
|
| 54 |
+
export MISTRAL_API_KEY="$LLM_API_KEY"
|
| 55 |
+
elif [[ "$LLM_MODEL" == "cohere/"* ]]; then
|
| 56 |
+
export COHERE_API_KEY="$LLM_API_KEY"
|
| 57 |
+
elif [[ "$LLM_MODEL" == "groq/"* ]]; then
|
| 58 |
+
export GROQ_API_KEY="$LLM_API_KEY"
|
| 59 |
else
|
| 60 |
# Default to Anthropic for claude/* or anthropic/* models
|
| 61 |
export ANTHROPIC_API_KEY="$LLM_API_KEY"
|