Notice: Syft Router is in ALPHA. A major update will arrive mid-November — stay connected for updates.

Default Router Guide

Create a batteries-included router with pre-configured Ollama for chat and ChromaDB for search. Perfect for getting started quickly without managing external infrastructure.

What is a Default Router?

A Default Router comes with pre-packaged components for ease of use. It's designed to get you up and running with minimal configuration, providing everything you need to start serving AI-powered chat and search capabilities.

🤖

Chat Service

Pre-configured with Ollama for local LLM hosting. No API keys needed, runs entirely on your infrastructure.

🔍

Search Service

Built-in ChromaDB for vector storage and retrieval. Automatically indexes your documents for semantic search.

📊

Monitoring

Health checks and status tracking built-in. Know when your services are running and track their performance.

Prerequisites

Before creating a default router, ensure you have:

Creating a Default Router

Step 1: Access the Dashboard

  1. Open http://localhost:8080 or navigate to it within SyftUI
  2. Choose "Provider" profile if this is your first time
  3. Click "Create Router"

Step 2: Configure Router

  1. Configure router's metadata:
    • Name: Choose a descriptive name for your router
    • Summary: Keep it short and descriptive
    • Description: Use markdown for detailed information
  2. For the router type, select Default
  3. Choose the services you want to support:
    • Chat: For conversational AI capabilities
    • Search: For document search and retrieval
💡 Tip

If you have some data and want a lightweight setup, selecting only "Search" should suffice. You can always add chat capabilities later.

Step 3: Router Generation

The system automatically handles the setup for you:

Generated Structure

After creation, you'll find this structure in your SyftBox apps directory:

my-router/
├── server.py            # Main FastAPI server
├── chat_service.py      # Ollama chat implementation
├── search_service.py    # ChromaDB search
├── spawn_services.py    # Service monitoring
├── pyproject.toml       # Dependencies
├── run.sh              # Startup script
└── data/               # ChromaDB storage

Adding Your First Files (Search Only)

If you enabled the Search service, you can start adding your files to index:

  1. Check under SyftBox/apps for an app called local-rag
  2. Navigate to its UI once spotted
  3. Select the file paths you want to process
  4. The system will automatically index your documents
Supported Formats
  • .md, .pdf, .json, .yaml, .txt
  • Need custom formats? Contact OpenMined for support
  • For dynamic data: Create a Syft app or cronjob to fetch from WordPress, Silverchair, Ghost, Medium, Slack, Notion, or REST APIs

Testing Your Router

Via Dashboard

  1. Go to router list in your dashboard
  2. Select your router from the dropdown list
  3. Send a test message: "Hello!" or any query
  4. Verify responses are coming from your services

Via API

Test your chat endpoint:

curl -X POST https://syftbox.net/api/v1/send/ \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What is machine learning?",
    "suffix-sender": "true",
    "timeout": "5000",
    "x-syft-from": "guest@syftbox.net",
    "x-syft-url": "syft://<your_email>/app_data/my_router/rpc/chat"
  }'

Test your search endpoint:

curl -X POST https://syftbox.net/api/v1/send/ \
  -H "Content-Type: application/json" \
  -d '{
    "query": "machine learning concepts",
    "suffix-sender": "true",
    "timeout": "5000",
    "x-syft-from": "guest@syftbox.net",
    "x-syft-url": "syft://<your_email>/app_data/my_router/rpc/search"
  }'

Publishing Your Router

Once you're happy with your router's performance, make it available to others:

  1. Test thoroughly: Ensure both chat and search work reliably
  2. Add metadata: Go to router details → "Publish"
  3. Set pricing: Configure per-request pricing
  4. Publish: Make available to other users
Summary: "AI assistant with document search"
Description: "Powered by Llama2 and ChromaDB"
Tags: ["chat", "search", "llama2"]
Pricing:
  Chat: $0.01 per request
  Search: $0.005 per request

Monitoring & Maintenance

The system automatically monitors your router's health and shows status in the UI. When troubleshooting:

View Logs

# View router logs
tail -f ~/SyftBox/apps/my-router/logs/app.log

Common Issues