You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solana Agent supports using Grok from xAI as an alternative to OpenAI. When Grok is configured, it will be used for all LLM operations except embeddings, TTS, and STT (which still require OpenAI).
543
+
544
+
**Note:** Grok configuration takes priority over OpenAI. If both are present, Grok will be used.
545
+
546
+
```python
547
+
config = {
548
+
"grok": {
549
+
"api_key": "your-grok-api-key",
550
+
"base_url": "https://api.x.ai/v1", # Optional, defaults to https://api.x.ai/v1
551
+
"model": "grok-4-1-fast-non-reasoning"# Optional, defaults to grok-4-1-fast-non-reasoning
552
+
},
553
+
# You can still include OpenAI for embeddings, TTS, and STT
554
+
"openai": {
555
+
"api_key": "your-openai-api-key"
556
+
},
557
+
"agents": [
558
+
{
559
+
"name": "research_specialist",
560
+
"instructions": "You are an expert researcher.",
561
+
"specialization": "Research",
562
+
}
563
+
],
564
+
}
565
+
```
566
+
567
+
**Verified Capabilities:**
568
+
- ✅ Chat completions
569
+
- ✅ Streaming responses
570
+
- ✅ Function calling/Tool usage
571
+
- ✅ Structured outputs (via Instructor TOOLS_STRICT and JSON modes)
0 commit comments