# Open Notebook - Netcup RS 8000 Deployment Self-hosted NotebookLM alternative integrated with the AI orchestrator stack. ## Architecture ``` Open Notebook ├── Frontend (Next.js) → port 8502 → Traefik → notebook.jeffemmett.com ├── API (FastAPI) → port 5055 ├── Database (SurrealDB) → embedded └── AI Providers: ├── LLM → Ollama (local, FREE) ├── Embeddings → Ollama (local, FREE) ├── STT → Groq/OpenAI (cloud) └── TTS → ElevenLabs/OpenAI (cloud, for podcasts) ``` ## Quick Deploy ```bash # 1. SSH to Netcup ssh netcup # 2. Clone/copy the deployment files cd /opt/websites git clone https://gitea.jeffemmett.com/jeff/open-notebook.git # OR copy files manually mkdir -p /opt/websites/open-notebook cd /opt/websites/open-notebook # 3. Pull required Ollama models docker exec ollama ollama pull llama3.2:3b # Fast LLM docker exec ollama ollama pull llama3.1:8b # Better LLM docker exec ollama ollama pull nomic-embed-text # Embeddings # 4. Edit docker.env with your API keys (optional) nano docker.env # 5. Deploy docker compose up -d # 6. Verify docker logs -f open-notebook ``` ## Configure DNS (Cloudflare Tunnel) ### Option A: Add to existing tunnel config ```bash ssh netcup nano /root/cloudflared/config.yml ``` Add: ```yaml - hostname: notebook.jeffemmett.com service: http://localhost:80 ``` Restart cloudflared: ```bash docker restart cloudflared ``` ### Option B: Cloudflare Dashboard 1. Go to Cloudflare Zero Trust → Access → Tunnels 2. Select your tunnel → Public Hostnames 3. Add `notebook.jeffemmett.com` → `http://localhost:80` ### DNS Records (if not using wildcard) In Cloudflare DNS, add CNAME: - Type: CNAME - Name: notebook - Target: a838e9dc-0af5-4212-8af2-6864eb15e1b5.cfargotunnel.com - Proxy: Enabled ## AI Provider Configuration ### Local (FREE) - Already configured | Feature | Provider | Model | Cost | |---------|----------|-------|------| | LLM | Ollama | llama3.2:3b, llama3.1:8b | FREE | | Embeddings | Ollama | nomic-embed-text | FREE | ### Cloud (for premium features) | Feature | Recommended Provider | Notes | |---------|---------------------|-------| | STT | **Groq** (free tier) | Fast Whisper, 100 hrs/month free | | TTS | ElevenLabs | Best voice quality for podcasts | | TTS (alt) | OpenAI | Cheaper, good quality | ### Adding API Keys Edit `docker.env`: ```bash # For Speech-to-Text (transcription) GROQ_API_KEY=gsk_your_key_here # For Text-to-Speech (podcasts) ELEVENLABS_API_KEY=your_key_here # OR OPENAI_API_KEY=sk-your_key_here ``` Then restart: ```bash docker compose restart ``` ## Useful Commands ```bash # View logs docker logs -f open-notebook # Restart docker compose restart # Update to latest version docker compose pull docker compose up -d # Check Ollama models docker exec ollama ollama list # Pull new Ollama model docker exec ollama ollama pull mistral:7b # Backup data tar -czvf notebook-backup.tar.gz notebook_data surreal_data ``` ## Accessing Open Notebook - **Web UI**: https://notebook.jeffemmett.com - **API Docs**: https://notebook.jeffemmett.com/api/docs (if exposed) - **Local**: http://159.195.32.209:8502 ## Integration with AI Orchestrator The Open Notebook instance connects to the same Ollama service used by the AI orchestrator, sharing: - Model cache (no duplicate downloads) - Compute resources - Network (ai-orchestrator_ai-internal) For advanced routing (e.g., GPU-accelerated inference via RunPod), configure the AI orchestrator to expose OpenAI-compatible endpoints. ## Troubleshooting **Container won't start:** ```bash docker logs open-notebook # Check if ports are in use netstat -tlnp | grep -E '8502|5055' ``` **Can't connect to Ollama:** ```bash # Verify network connectivity docker exec open-notebook curl http://ollama:11434/api/tags ``` **Database issues:** ```bash # Reset database (CAUTION: loses data) docker compose down rm -rf surreal_data docker compose up -d ```