API reference
Configuration

Environment Variables

Jan Server configuration is managed through environment variables defined in the Helm values file at charts/umbrella-chart/values.yaml.

API Gateway Configuration

Core Settings

VariableDefaultDescription
JAN_INFERENCE_MODEL_URLhttp://jan-server-jan-inference-model:8101Internal URL for inference service

Authentication

VariablePurposeFormat
JWT_SECRETJWT token signingBase64 encoded HMAC-SHA256 key
APIKEY_SECRETAPI key signingBase64 encoded HMAC-SHA256 key

The default JWT and API key secrets are for development only. Generate new secrets for production deployments.

OAuth2 Integration

VariableDescription
OAUTH2_GOOGLE_CLIENT_IDGoogle OAuth2 application client ID
OAUTH2_GOOGLE_CLIENT_SECRETGoogle OAuth2 application secret
OAUTH2_GOOGLE_REDIRECT_URLCallback URL for OAuth2 flow

External APIs

VariableProviderPurpose
SERPER_API_KEYSerperWeb search integration

Database Connection

VariableDefaultDescription
DB_POSTGRESQL_WRITE_DSNhost=jan-server-postgresql user=jan-user password=jan-password dbname=jan port=5432 sslmode=disableWrite database connection
DB_POSTGRESQL_READ1_DSNhost=jan-server-postgresql user=jan-user password=jan-password dbname=jan port=5432 sslmode=disableRead database connection

Helm Configuration

Updating Values

Edit the configuration in charts/umbrella-chart/values.yaml:


jan-api-gateway:
env:
- name: SERPER_API_KEY
value: your_serper_api_key
- name: OAUTH2_GOOGLE_CLIENT_ID
value: your_google_client_id
- name: OAUTH2_GOOGLE_CLIENT_SECRET
value: your_google_client_secret

Applying Changes

After modifying values, redeploy the application:


helm upgrade jan-server ./charts/umbrella-chart

Authentication Setup

JWT Tokens

Generate a secure JWT signing key:


# Generate 256-bit key for HMAC-SHA256
openssl rand -base64 32

Update the JWT_SECRET value in your Helm configuration.

API Keys

Generate a secure API key signing secret:


# Generate 256-bit key for HMAC-SHA256
openssl rand -base64 32

Update the APIKEY_SECRET value in your Helm configuration.

Google OAuth2

  1. Create Google Cloud Project

  2. Enable OAuth2

    • Navigate to "APIs & Services" > "Credentials"
    • Create OAuth2 client ID credentials
    • Set application type to "Web application"
  3. Configure Redirect URI


    http://localhost:8080/auth/google/callback

  4. Update Configuration

    • Set OAUTH2_GOOGLE_CLIENT_ID to your client ID
    • Set OAUTH2_GOOGLE_CLIENT_SECRET to your client secret
    • Set OAUTH2_GOOGLE_REDIRECT_URL to your callback URL

External Integrations

Serper API

Jan Server integrates with Serper for web search capabilities.

  1. Get API Key

  2. Configure

    • Set SERPER_API_KEY in Helm values
    • Redeploy the application

Adding New Integrations

To add new external API integrations:

  1. Update Helm Values


    jan-api-gateway:
    env:
    - name: YOUR_API_KEY
    value: your_api_key_value

  2. Update Go Configuration

    Add to config/environment_variables/env.go:


    YourAPIKey string `env:"YOUR_API_KEY"`

  3. Redeploy


    helm upgrade jan-server ./charts/umbrella-chart

Database Configuration

Connection Settings

The default PostgreSQL configuration uses:

  • Host: jan-server-postgresql (Kubernetes service name)
  • Database: jan
  • User: jan-user
  • Password: jan-password
  • Port: 5432
  • SSL: Disabled (development only)

Production Database

For production deployments:

  1. External Database

    • Use managed PostgreSQL service (AWS RDS, Google Cloud SQL)
    • Update DSN variables with external connection details
  2. SSL/TLS

    • Enable sslmode=require in connection strings
    • Configure certificate validation
  3. Connection Pooling

    • Consider using connection pooler (PgBouncer, pgpool-II)
    • Configure appropriate pool sizes

Model Configuration

The inference model service is configured via Docker CMD parameters:


CMD ["--model", "/models/Jan-v1-4B", \
"--served-model-name", "jan-v1-4b", \
"--host", "0.0.0.0", \
"--port", "8101", \
"--max-num-batched-tokens", "1024", \
"--enable-auto-tool-choice", \
"--tool-call-parser", "hermes", \
"--reasoning-parser", "qwen3"]

Model Parameters

ParameterValueDescription
--model/models/Jan-v1-4BPath to model files
--served-model-namejan-v1-4bAPI model identifier
--max-num-batched-tokens1024Maximum tokens per batch
--tool-call-parserhermesTool calling format
--reasoning-parserqwen3Reasoning output format

Model configuration changes require rebuilding the inference Docker image. This will be configurable via environment variables in future releases.

Resource Configuration

Kubernetes Resources

Current deployments use default resource limits. For production:


jan-api-gateway:
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
jan-inference-model:
resources:
requests:
cpu: 1000m
memory: 4Gi
limits:
cpu: 4000m
memory: 8Gi

Storage

PostgreSQL uses default Kubernetes storage. For production:


postgresql:
persistence:
enabled: true
size: 20Gi
storageClass: fast-ssd

Logging Configuration

Configure logging levels via environment variables:


jan-api-gateway:
env:
- name: LOG_LEVEL
value: info
- name: LOG_FORMAT
value: json

Available log levels: debug, info, warn, error Available formats: text, json