Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ CONVERSATION_SHARING_ENABLED=true
# ============================================================================
MCP_TOOLS_HTTP_PORT=8091

# LLM API connection for tool tracking and dynamic tool descriptions
LLM_API_BASE_URL=http://llm-api:8080
MCP_TRACKING_ENABLED=true

# Search engine configuration
SEARCH_ENGINE=serper # Options: serper, searxng
SERPER_DOMAIN_FILTER= # Optional: domain filter for search results
Expand Down Expand Up @@ -223,6 +227,24 @@ MEDIA_PROXY_DOWNLOAD=true
MEDIA_RETENTION_DAYS=30
MEDIA_REMOTE_FETCH_TIMEOUT=15s

# ============================================================================
# Realtime API (LiveKit Integration)
# ============================================================================
# OpenAI Realtime API compatible service using LiveKit as transport
# Uses global auth settings (ISSUER, AUDIENCE, JWKS_URL) when AUTH_ENABLED=true
REALTIME_API_ENABLED=true
REALTIME_API_PORT=8186

# LiveKit Configuration (required)
LIVEKIT_WS_URL=wss://your-livekit-server.com
LIVEKIT_API_KEY=your-livekit-api-key
LIVEKIT_API_SECRET=your-livekit-api-secret
LIVEKIT_TOKEN_TTL=24h

# Session management
SESSION_CLEANUP_INTERVAL=15s
SESSION_STALE_TTL=10m

# ============================================================================
# Template API (copy when running the scaffold locally)
# ============================================================================
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
response-api: ${{ steps.filter.outputs.response-api }}
memory-tools: ${{ steps.filter.outputs.memory-tools }}
vector-store: ${{ steps.filter.outputs.vector-store }}
realtime-api: ${{ steps.filter.outputs.realtime-api }}
pkg: ${{ steps.filter.outputs.pkg }}
steps:
- uses: actions/checkout@v4
Expand All @@ -39,6 +40,8 @@ jobs:
- 'services/memory-tools/**'
vector-store:
- 'services/mcp-tools/tools/vector-store-service/**'
realtime-api:
- 'services/realtime-api/**'
pkg:
- 'pkg/**'

Expand Down Expand Up @@ -129,5 +132,20 @@ jobs:
registry-url: registry.menlo.ai
tags: registry.menlo.ai/jan-server/vector-store-service:dev-${{ github.sha }}
is_push: ${{ github.event_name == 'push' }}
build-args: |
VERSION_TAG=dev-${{ github.sha }}

build-realtime-api:
needs: changes
if: needs.changes.outputs.realtime-api == 'true' || needs.changes.outputs.pkg == 'true'
uses: ./.github/workflows/template-docker.yml
secrets: inherit
with:
runs-on: ubuntu-24-04-docker
docker-file: services/realtime-api/Dockerfile
context: services/realtime-api
registry-url: registry.menlo.ai
tags: registry.menlo.ai/jan-server/realtime-api:dev-${{ github.sha }}
is_push: ${{ github.event_name == 'push' }}
build-args: |
VERSION_TAG=dev-${{ github.sha }}
18 changes: 18 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
response-api: ${{ steps.filter.outputs.response-api }}
memory-tools: ${{ steps.filter.outputs.memory-tools }}
vector-store: ${{ steps.filter.outputs.vector-store }}
realtime-api: ${{ steps.filter.outputs.realtime-api }}
pkg: ${{ steps.filter.outputs.pkg }}
steps:
- uses: actions/checkout@v4
Expand All @@ -34,6 +35,8 @@ jobs:
- 'services/memory-tools/**'
vector-store:
- 'services/mcp-tools/tools/vector-store-service/**'
realtime-api:
- 'services/realtime-api/**'
pkg:
- 'pkg/**'

Expand Down Expand Up @@ -124,5 +127,20 @@ jobs:
registry-url: registry.menlo.ai
tags: registry.menlo.ai/jan-server/vector-store-service:prod-${{ github.sha }}
is_push: ${{ github.event_name == 'push' }}
build-args: |
VERSION_TAG=prod-${{ github.sha }}

build-realtime-api:
needs: changes
if: needs.changes.outputs.realtime-api == 'true' || needs.changes.outputs.pkg == 'true'
uses: ./.github/workflows/template-docker.yml
secrets: inherit
with:
runs-on: ubuntu-24-04-docker
docker-file: services/realtime-api/Dockerfile
context: services/realtime-api
registry-url: registry.menlo.ai
tags: registry.menlo.ai/jan-server/realtime-api:prod-${{ github.sha }}
is_push: ${{ github.event_name == 'push' }}
build-args: |
VERSION_TAG=prod-${{ github.sha }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ dist/
.DS_Store
cmd/server/__debug_bin*

# Service binaries
services/*/bin/

# Downloaded models (large files - root directory only)
/models/

Expand Down
38 changes: 31 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,14 @@ install-deps:
# SECTION 3: BUILD TARGETS
# ============================================================================================================

.PHONY: build build-api build-mcp build-memory build-all clean-build build-llm-api build-media-api build-response-api build-memory-tools
.PHONY: build build-api build-mcp build-memory build-realtime build-all clean-build build-llm-api build-media-api build-response-api build-realtime-api build-memory-tools

build: build-api build-mcp build-memory

build-api: build-llm-api build-media-api build-response-api

build-realtime: build-realtime-api

build-memory: build-memory-tools

build-llm-api:
Expand Down Expand Up @@ -161,6 +163,15 @@ else
endif
@echo " Response API built: services/response-api/bin/response-api"

build-realtime-api:
@echo "Building Realtime API..."
ifeq ($(OS),Windows_NT)
@cd services/realtime-api && go build -o bin/realtime-api.exe ./cmd/server
else
@cd services/realtime-api && go build -o bin/realtime-api ./cmd/server
endif
@echo " Realtime API built: services/realtime-api/bin/realtime-api"

build-mcp:
@echo "Building MCP Tools..."
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -239,7 +250,7 @@ cli-clean:

# --- Swagger Documentation ---

.PHONY: swagger swagger-llm-api swagger-media-api swagger-mcp-tools swagger-response-api swagger-combine swagger-install
.PHONY: swagger swagger-llm-api swagger-media-api swagger-mcp-tools swagger-response-api swagger-realtime-api swagger-combine swagger-install

swagger:
@echo "Generating Swagger documentation for all services..."
Expand Down Expand Up @@ -285,8 +296,17 @@ else
endif
@echo " response-api swagger generated at services/response-api/docs/swagger"

swagger-realtime-api:
@echo "Generating Swagger for realtime-api service..."
ifeq ($(OS),Windows_NT)
@powershell -ExecutionPolicy Bypass -File jan-cli.ps1 swagger generate -s realtime-api
else
@bash jan-cli.sh swagger generate -s realtime-api
endif
@echo " realtime-api swagger generated at services/realtime-api/docs/swagger"

swagger-combine:
@echo \"Merging LLM API and MCP Tools swagger specs...\"
@echo \"Merging LLM API, MCP Tools, and Realtime API swagger specs...\"
ifeq ($(OS),Windows_NT)
@powershell -ExecutionPolicy Bypass -File jan-cli.ps1 swagger combine
else
Expand Down Expand Up @@ -438,6 +458,8 @@ up-full: ## Start full stack (all services in Docker)
@echo ""
@echo "Services:"
@echo " - LLM API: http://localhost:8080"
@echo " - Media API: http://localhost:8285"
@echo " - Realtime API: http://localhost:8186"
@echo " - MCP Tools: http://localhost:8091"
@echo " - Vector Store: http://localhost:3015"
@echo " - vLLM (if enabled): http://localhost:8101"
Expand Down Expand Up @@ -775,8 +797,9 @@ ifeq ($(OS),Windows_NT)
@powershell -Command "try { $$null = docker compose exec -T api-db pg_isready -U jan_user 2>&1 | Out-Null; if ($$LASTEXITCODE -eq 0) { Write-Host ' PostgreSQL: healthy' } else { Write-Host ' PostgreSQL: unhealthy' } } catch { Write-Host ' PostgreSQL: unhealthy' }"
@echo.
@echo [API Services]
@powershell -Command "try { $$null = Invoke-WebRequest -Uri http://localhost:8080/healthz -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop; Write-Host ' LLM API: healthy' } catch { Write-Host ' LLM API: unhealthy' }"
@powershell -Command "try { $$null = Invoke-WebRequest -Uri http://localhost:8285/healthz -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop; Write-Host ' Media API: healthy' } catch { try { if ($$PSItem.Exception.Response.StatusCode.Value__ -eq 401) { Write-Host ' Media API: healthy' } else { Write-Host ' Media API: unhealthy' } } catch { Write-Host ' Media API: unhealthy' } }"
@powershell -Command "try { $$null = Invoke-WebRequest -Uri http://localhost:8080/healthz -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop; Write-Host ' LLM API: healthy' } catch { Write-Host ' LLM API: unhealthy' }"
@powershell -Command "try { $$null = Invoke-WebRequest -Uri http://localhost:8285/healthz -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop; Write-Host ' Media API: healthy' } catch { try { if ($$PSItem.Exception.Response.StatusCode.Value__ -eq 401) { Write-Host ' Media API: healthy' } else { Write-Host ' Media API: unhealthy' } } catch { Write-Host ' Media API: unhealthy' } }"
@powershell -Command "try { $$null = Invoke-WebRequest -Uri http://localhost:8186/healthz -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop; Write-Host ' Realtime API: healthy' } catch { Write-Host ' Realtime API: not running' }"
@echo.
@echo [MCP Services]
@powershell -Command "try { $$null = Invoke-WebRequest -Uri http://localhost:8091/healthz -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop; Write-Host ' MCP Tools: healthy' } catch { Write-Host ' MCP Tools: unhealthy' }"
Expand All @@ -798,8 +821,9 @@ else
@$(COMPOSE) exec -T api-db pg_isready -U jan_user >/dev/null 2>&1 && echo " PostgreSQL: healthy" || echo " PostgreSQL: unhealthy"
@echo ""
@echo "[API Services]"
@curl -sf http://localhost:8080/healthz >/dev/null && echo " LLM API: healthy" || echo " LLM API: unhealthy"
@curl -s http://localhost:8285/healthz >/dev/null && echo " Media API: healthy" || (curl -s -w "%{http_code}" -o /dev/null http://localhost:8285/healthz | grep -q "401" && echo " Media API: healthy" || echo " Media API: unhealthy")
@curl -sf http://localhost:8080/healthz >/dev/null && echo " LLM API: healthy" || echo " LLM API: unhealthy"
@curl -s http://localhost:8285/healthz >/dev/null && echo " Media API: healthy" || (curl -s -w "%{http_code}" -o /dev/null http://localhost:8285/healthz | grep -q "401" && echo " Media API: healthy" || echo " Media API: unhealthy")
@curl -sf http://localhost:8186/healthz >/dev/null && echo " Realtime API: healthy" || echo " Realtime API: not running"
@echo ""
@echo "[MCP Services]"
@curl -sf http://localhost:8091/healthz >/dev/null && echo " MCP Tools: healthy" || echo " MCP Tools: unhealthy"
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The `quickstart` target wraps `jan-cli` and guides you through:
- Selecting the LLM provider (local vLLM vs remote OpenAI-compatible endpoint)
- Choosing the MCP search provider (Serper, SearXNG, or disabled)
- Enabling or disabling the Media API
- Enabling or disabling the Realtime API (LiveKit-based real-time communication)

Need to rerun the wizard? Execute `make quickstart` again and accept the prompt to update your `.env`.

Expand Down Expand Up @@ -108,9 +109,10 @@ jan-server/
| |-- response-api/
| |-- media-api/
| |-- mcp-tools/
| |-- realtime-api/
| |-- template-api/
|-- docs/ # Documentation hub
|-- docker/ # Compose profiles (infra, api, mcp, inference)
|-- docker/ # Compose profiles (infra, api, mcp, realtime, inference)
|-- monitoring/ # Grafana, Prometheus, OTEL configs
|-- k8s/ # Helm chart + setup guide
|-- config/ # Environment templates and helpers
Expand Down Expand Up @@ -138,6 +140,7 @@ Key directories:
| Response API | Multi-step orchestration using MCP tools | 8082 | `services/response-api` | `docs/api/response-api/README.md` |
| Media API | jan_* IDs, S3 ingest, media resolution | 8285 | `services/media-api` | `docs/api/media-api/README.md` |
| MCP Tools | Model Context Protocol tools (search, scrape, file search, python) | 8091 | `services/mcp-tools` | `docs/api/mcp-tools/README.md` |
| Realtime API | LiveKit-based real-time audio/video sessions (optional) | 8186 | `services/realtime-api` | `services/realtime-api/README.md` |

See [docs/architecture/services.md](docs/architecture/services.md) for dependency graphs and integration notes.

Expand Down Expand Up @@ -180,6 +183,7 @@ make build-llm-api # Build LLM API
make build-response-api # Build Response API
make build-media-api # Build Media API
make build-mcp # Build MCP Tools
make build-realtime-api # Build Realtime API

# Development
make test-all # Run all test suites
Expand All @@ -202,6 +206,7 @@ make logs-llm-api # View LLM API logs
make logs-response-api # View Response API logs
make logs-media-api # View Media API logs
make logs-mcp # View MCP Tools logs
make logs-realtime-api # View Realtime API logs
make health-check # Check all services health

# Database
Expand Down Expand Up @@ -415,10 +420,14 @@ More examples: [API Documentation ->](docs/api/)
### Docker Compose Profiles

```bash
make up-full # All services
make up-full # All services (including optional ones)
make up-gpu # With GPU inference
make up-cpu # CPU-only inference
make monitor-up # Add monitoring stack

# Optional services (enabled via profiles)
docker compose --profile realtime up -d # Start Realtime API
docker compose --profile memory up -d # Start Memory Tools
```

### Environment Configuration
Expand Down Expand Up @@ -511,6 +520,7 @@ See [Monitoring Guide](docs/guides/monitoring.md) for configuration.
- Response API: Go 1.21+ with Gin, GORM, Wire DI
- Media API: Go 1.21+ with Gin, GORM, S3 SDK
- MCP Tools: Go 1.21+ with JSON-RPC 2.0
- Realtime API: Go 1.21+ with Gin, LiveKit SDK

## Contributing

Expand Down
Loading
Loading