Skip to content

Commit 0c6effd

Browse files
Release on new jan-server (#267)
- Consolidated Makefile structure (single file with 10 sections) - Hybrid development mode for faster iteration - MCP (Model Context Protocol) provider integration - Full observability stack (Prometheus, Jaeger, Grafana) - OpenTelemetry integration - Guest authentication with Keycloak token exchange - Comprehensive testing suite with jan-cli api-test - Documentation for all major features
1 parent 68b8514 commit 0c6effd

716 files changed

Lines changed: 105807 additions & 41080 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.template

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# ============================================================================
2+
# Jan Server Environment Configuration Template
3+
# ============================================================================
4+
# Copy this file to .env and customize for your environment
5+
#
6+
# Quick Start:
7+
# make env-create # Creates .env from this template
8+
# make env-switch ENV=hybrid # Switch to hybrid development mode
9+
#
10+
# Available Environments:
11+
# - development (all services in Docker) - config/development.env
12+
# - hybrid (native services + Docker) - config/hybrid.env
13+
# - testing (integration testing) - config/testing.env
14+
# - production (production deployment) - config/production.env.example
15+
#
16+
# Documentation: See config/README.md for detailed environment guide
17+
# ============================================================================
18+
19+
# ============================================================================
20+
# Docker Compose Configuration
21+
# ============================================================================
22+
# Profile selection for docker-compose services
23+
# Profiles are comma-separated and control which services start:
24+
# infra - Infrastructure (PostgreSQL, Keycloak, Kong) - always needed
25+
# api - API services (llm-api, media-api, response-api) - always needed
26+
# mcp - MCP Tools and Vector Store - always included
27+
# full - Includes vLLM GPU inference (for local GPU provider)
28+
#
29+
# Examples:
30+
# COMPOSE_PROFILES=infra,api,mcp,full - Local vLLM (full setup with GPU)
31+
# COMPOSE_PROFILES=infra,api,mcp - Remote API provider (no vLLM)
32+
COMPOSE_PROFILES=infra,api,mcp,full
33+
34+
# ============================================================================
35+
# REQUIRED: Secrets & API Keys
36+
# ============================================================================
37+
# You MUST set these values before running the services
38+
39+
# HuggingFace API token (required for model downloads). The local vLLM provider needs this token.
40+
# If you plan to use a remote provider instead, comment this out and edit
41+
# services/llm-api/config/providers.yml to point at the provider you want.
42+
# Get from: https://huggingface.co/settings/tokens
43+
HF_TOKEN=your_huggingface_token_here
44+
45+
# Serper API key (required for MCP google_search tool)
46+
# Get from: https://serper.dev
47+
SERPER_API_KEY=your_serper_api_key_here
48+
49+
# Security secrets (CHANGE THESE in production!)
50+
POSTGRES_PASSWORD=jan_password
51+
KEYCLOAK_ADMIN_PASSWORD=admin
52+
BACKEND_CLIENT_SECRET=backend-secret
53+
MODEL_PROVIDER_SECRET=jan-model-provider-secret-2024
54+
VLLM_INTERNAL_KEY=changeme
55+
56+
# ============================================================================
57+
# PostgreSQL Database
58+
# ============================================================================
59+
POSTGRES_USER=jan_user
60+
POSTGRES_DB=jan_llm_api
61+
POSTGRES_PORT=5432
62+
KEYCLOAK_DB_PORT=5433
63+
64+
# Database connection (varies by environment)
65+
# Development: postgres://jan_user:password@api-db:5432/jan_llm_api
66+
# Hybrid: postgres://jan_user:password@localhost:5432/jan_llm_api
67+
DB_DSN=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@api-db:5432/${POSTGRES_DB}?sslmode=disable
68+
DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@api-db:5432/${POSTGRES_DB}?sslmode=disable
69+
70+
# ============================================================================
71+
# LLM API Service
72+
# ============================================================================
73+
HTTP_PORT=8080
74+
LOG_LEVEL=info
75+
LOG_FORMAT=json
76+
AUTO_MIGRATE=true
77+
78+
# ============================================================================
79+
# Authentication (Keycloak)
80+
# ============================================================================
81+
# Note: JWKS_URL uses internal Docker hostname, ISSUER uses localhost for external clients
82+
KEYCLOAK_ADMIN=admin
83+
KEYCLOAK_HTTP_PORT=8085
84+
KEYCLOAK_REALM=jan
85+
86+
# OAuth/OIDC Configuration (varies by environment)
87+
# Development (inside Docker): http://keycloak:8085
88+
# External/Hybrid: set KEYCLOAK_PUBLIC_HOST to your host (e.g., localhost or LAN IP) and KEYCLOAK_PUBLIC_PORT to the exposed port.
89+
KEYCLOAK_BASE_URL=http://keycloak:8085
90+
KEYCLOAK_PUBLIC_HOST=localhost
91+
KEYCLOAK_PUBLIC_PORT=${KEYCLOAK_HTTP_PORT:-8085}
92+
KEYCLOAK_PUBLIC_URL=http://${KEYCLOAK_PUBLIC_HOST}:${KEYCLOAK_PUBLIC_PORT}
93+
KEYCLOAK_ADMIN_URL=http://${KEYCLOAK_PUBLIC_HOST}:${KEYCLOAK_PUBLIC_PORT}
94+
JWKS_URL=http://keycloak:8085/realms/jan/protocol/openid-connect/certs
95+
ISSUER=${KEYCLOAK_PUBLIC_URL}/realms/${KEYCLOAK_REALM}
96+
AUDIENCE=account
97+
REFRESH_JWKS_INTERVAL=5m
98+
99+
# OAuth2 redirect URI (must match Keycloak client configuration)
100+
# This is where Keycloak redirects after authentication
101+
OAUTH_REDIRECT_URI=http://localhost:8000/auth/callback
102+
103+
# Guest provisioning
104+
BACKEND_CLIENT_ID=backend
105+
TARGET_CLIENT_ID=jan-client
106+
GUEST_ROLE=guest
107+
108+
# ============================================================================
109+
# API Gateway (Kong)
110+
# ============================================================================
111+
KONG_HTTP_PORT=8000
112+
113+
# ============================================================================
114+
# Inference (vLLM)
115+
# ============================================================================
116+
VLLM_PORT=8101
117+
VLLM_MODEL=Qwen/Qwen2.5-0.5B-Instruct
118+
VLLM_SERVED_NAME=qwen2.5-0.5b-instruct
119+
VLLM_GPU_UTIL=0.66
120+
VLLM_TOOL_SUPPORT=false
121+
# Model provider configuration
122+
JAN_PROVIDER_CONFIGS=true
123+
JAN_PROVIDER_CONFIGS_FILE=config/providers.yml
124+
JAN_PROVIDER_CONFIG_SET=default
125+
# Legacy fallback (single provider) - leave disabled unless needed
126+
# JAN_DEFAULT_NODE_SETUP=true
127+
# JAN_DEFAULT_NODE_URL=http://vllm-jan-gpu:8001/v1
128+
# JAN_DEFAULT_NODE_API_KEY=${VLLM_INTERNAL_KEY}
129+
130+
# ============================================================================
131+
# MCP Tools Service
132+
# ============================================================================
133+
MCP_TOOLS_HTTP_PORT=8091
134+
135+
# Search engine configuration
136+
SEARCH_ENGINE=serper # Options: serper, searxng
137+
SERPER_DOMAIN_FILTER= # Optional: domain filter for search results
138+
SERPER_LOCATION_HINT= # Optional: location hint for search
139+
SERPER_OFFLINE_MODE=false # Set true for offline testing
140+
141+
# MCP Provider URLs (vary by environment)
142+
# Development: http://searxng:8080
143+
# Hybrid: http://localhost:8086
144+
SEARXNG_PORT=8086
145+
SEARXNG_URL=http://searxng:8080
146+
VECTOR_STORE_PORT=3015
147+
VECTOR_STORE_URL=http://vector-store:3015
148+
SANDBOXFUSION_PORT=3010
149+
SANDBOXFUSION_URL=http://sandboxfusion:3010
150+
SANDBOX_FUSION_REQUIRE_APPROVAL=true
151+
MCP_ENABLE_PYTHON_EXEC=true
152+
MCP_ENABLE_MEMORY_RETRIEVE=true
153+
154+
# Browser automation & code execution
155+
CODE_SANDBOX_ENABLED=true
156+
CODE_SANDBOX_URL=http://code-sandbox-mcp:3000/mcp
157+
PLAYWRIGHT_ENABLED=true
158+
PLAYWRIGHT_URL=http://playwright-mcp:3000
159+
160+
# MCP debugging
161+
MCP_PROVIDER_DEBUG=false
162+
163+
# ============================================================================
164+
# Observability (OpenTelemetry, Prometheus, Jaeger, Grafana)
165+
# ============================================================================
166+
OTEL_ENABLED=false # Enable telemetry collection
167+
OTEL_SERVICE_NAME=llm-api
168+
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
169+
OTEL_HTTP_PORT=4318
170+
OTEL_GRPC_PORT=4317
171+
172+
# Monitoring stack ports
173+
PROMETHEUS_PORT=9090
174+
JAEGER_UI_PORT=16686
175+
GRAFANA_PORT=3001
176+
GRAFANA_ADMIN_USER=admin
177+
GRAFANA_ADMIN_PASSWORD=admin
178+
179+
# ============================================================================
180+
# Media API Configuration
181+
# ============================================================================
182+
MEDIA_API_ENABLED=true
183+
MEDIA_API_PORT=8285
184+
MEDIA_SERVICE_KEY=changeme-media-key
185+
MEDIA_API_KEY=changeme-media-key
186+
187+
# Storage backend selection: "s3" or "local"
188+
MEDIA_STORAGE_BACKEND=local
189+
190+
# Local Storage Configuration (used when MEDIA_STORAGE_BACKEND=local)
191+
MEDIA_LOCAL_STORAGE_PATH=./media-data
192+
MEDIA_LOCAL_STORAGE_BASE_URL=http://localhost:8285/v1/files
193+
194+
# S3 Storage Configuration (used when MEDIA_STORAGE_BACKEND=s3)
195+
# MEDIA_S3_ENDPOINT=https://s3.menlo.ai
196+
# MEDIA_S3_PUBLIC_ENDPOINT=
197+
# MEDIA_S3_REGION=us-west-2
198+
# MEDIA_S3_BUCKET=platform-dev
199+
# MEDIA_S3_ACCESS_KEY_ID=7N33WPTUI1KN99MFILQS
200+
# MEDIA_S3_SECRET_ACCESS_KEY=ppxQsHpnfDSewYZD065aGjQeEQ0nTFA7c2aHNPz5
201+
# MEDIA_S3_USE_PATH_STYLE=true
202+
# MEDIA_S3_PRESIGN_TTL=5m
203+
204+
# Media service URLs
205+
MEDIA_API_URL=http://media-api:8285
206+
MEDIA_RESOLVE_URL=http://media-api:8285/v1/media/resolve
207+
MEDIA_RESOLVE_TIMEOUT=5s
208+
209+
# Media processing settings
210+
MEDIA_MAX_BYTES=20971520
211+
MEDIA_PROXY_DOWNLOAD=true
212+
MEDIA_RETENTION_DAYS=30
213+
MEDIA_REMOTE_FETCH_TIMEOUT=15s
214+
215+
# ============================================================================
216+
# Template API (copy when running the scaffold locally)
217+
# ============================================================================
218+
# TEMPLATE_DATABASE_URL=postgres://postgres:postgres@localhost:5432/template_api?sslmode=disable
219+
# SERVICE_NAME=template-api
220+
# ENVIRONMENT=development
221+
# HTTP_PORT=8185
222+
# LOG_LEVEL=info
223+
# ENABLE_TRACING=false
224+
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
225+
# SHUTDOWN_TIMEOUT=10s
226+
# DB_MAX_IDLE_CONNS=5
227+
# DB_MAX_OPEN_CONNS=15
228+
# DB_CONN_MAX_LIFETIME=30m
229+
# AUTH_ENABLED=false
230+
# AUTH_ISSUER=http://localhost:8080/realms/jan
231+
# AUTH_AUDIENCE=account
232+
# AUTH_JWKS_URL=http://localhost:8080/realms/jan/protocol/openid-connect/certs
233+
234+
# ============================================================================
235+
# Environment-Specific Overrides
236+
# ============================================================================
237+
# The above values work for Docker development (all services in containers)
238+
#
239+
# For other environments, use:
240+
# make env-switch ENV=hybrid # Run services natively
241+
# make env-switch ENV=testing # Integration testing
242+
#
243+
# Or manually copy from config/<environment>.env to .env
244+
#
245+
# See config/README.md for detailed environment configuration guide
246+
# ============================================================================

.github/ISSUE_TEMPLATE/1-bug-report.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/2-feature-request.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/3-epic.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/4-goal.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)