Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

add xspace-agent/examples/custom-provider/README.md

overstepping4c523f32d842
diff --git a/xspace-agent/examples/custom-provider/README.md b/xspace-agent/examples/custom-provider/README.md
new file mode 100644
index 000000000..8c6fec247
--- /dev/null
+++ b/xspace-agent/examples/custom-provider/README.md
@@ -0,0 +1,53 @@
+# Custom Provider Example
+
+Use a **local LLM** (via Ollama) or any custom API as the AI backend for your X Space agent. The LLM runs on your machine — only TTS still uses a cloud API.
+
+## Prerequisites
+
+- [Ollama](https://ollama.ai) installed and running
+- A model pulled: `ollama pull llama3`
+
+## Quickstart
+
+1. Install dependencies:
+ ```bash
+ npm install
+ ```
+
+2. Copy `.env.example` to `.env` and fill in your credentials:
+ ```bash
+ cp .env.example .env
+ ```
+
+3. Make sure Ollama is running, then start:
+ ```bash
+ ollama serve &
+ npm start https://x.com/i/spaces/1eaKbrPAqbwKX
+ ```
+
+## Adapting for Other Providers
+
+The `CustomProvider` interface requires a single `generateResponse` method:
+
+```typescript
+const myProvider: CustomProvider = {
+ type: 'socket',
+ async generateResponse({ messages, systemPrompt }) {
+ // Call any API, local model, or custom logic
+ return 'The response text'
+ }
+}
+```
+
+This works with any backend: vLLM, llama.cpp, text-generation-webui, LM Studio, or your own API.
+
+## Configuration
+
+| Env Var | Description | Default |
+|---------|-------------|---------|
+| `X_AUTH_TOKEN` | X authentication token | *required* |
+| `OPENAI_API_KEY` | OpenAI key for TTS | *required* |
+| `OLLAMA_HOST` | Ollama server URL | `http://localhost:11434` |
+| `OLLAMA_MODEL` | Ollama model name | `llama3` |
+
+