# On-Premises Deployment

Lynx AI Agent supports on-premises deployments for organizations that require data to remain within their own infrastructure - whether in a **private cloud** or a fully **air-gapped** network.

Both deployment types share the same backend setup. The only difference is the **AI engine**:

- **Private Cloud** - AI inference runs via a managed cloud provider, fully within your cloud tenant.
- **Air-gapped** - AI inference runs on a self-hosted open-weight model with no internet connectivity whatsoever.

## AI Engine

The Lynx AI backend requires an OpenAI-compatible completions endpoint. How you source it depends on your deployment type.

### Private Cloud

For private cloud deployments, use your cloud provider's managed AI service as the inference endpoint. Popular choices include:

- **Amazon Bedrock**
- **Google Vertex AI**
- **Microsoft Foundry**

All of these expose an OpenAI-compatible API and support Bearer key authentication.

### Air-gapped

> [!WARNING]
>
> A local inference engine is a pre-requisite for an air-gapped environment.

In an air-gapped deployment, Lynx AI Agent relies on the power of local LLMs for Splunk reasoning, tool execution, and guardrail protections (including malicious payload and prompt-injection checks).

We continuously evaluate new checkpoints, publish benchmarks, and update the supported model list as the industry evolves. Learn more about our supported models [here](<https://docs.trylynx.ai/advanced/model-performance/index.md>).

The inference endpoint must expose an OpenAI-compatible Completions API, be reachable from the backend over either HTTP or HTTPS, and may accept an optional Bearer key.

You can test the connection to the inference endpoint like this:

```bash
curl -H "Authorization: Bearer <API_KEY>" \
     -H "Content-Type: application/json" \
     -d '{"model":"glm-5.1","messages":[{"role":"user","content":"What is the meaning of life?"}]}' \
     https://example.com/api/v1/chat/completions # (1)!
```

1. Set the base URL to the inference endpoint in your organization.

## Lynx AI Backend

The backend ships as a hardened container image, deployable with Docker, Docker Compose, Kubernetes, or OpenShift.

Minimum allocation: 1 CPU core, 1 GB RAM, and a stable network path to the model endpoint. The backend is stateless and can be scaled horizontally behind a load balancer.

> [!WARNING]
>
> The backend image and the Splunk app are released together, and the app only talks to a backend whose **major and minor version match its own**. Upgrade both at the same time. We recommend pinning the image to the matching version tag rather than tracking `:latest`.

1. Create the following `.env` file:

   ```ini
   # .env

   # App
   ONPREM_MODE=true # (1)!
   TRUSTED_HOSTS=<host1>[,<host2>] # (2)!
   PORT=<port> # (3)!
   SSL_ENABLED=<boolean> # (4)!
   IPV6=<boolean> # (5)!

   # Inference
   INFERENCE_URL=<url> # (6)!
   INFERENCE_API_KEY=<api_key>
   INFERENCE_URL2=<url> # (7)!
   INFERENCE_API_KEY2=<api_key>
   GUARDRAIL=<boolean> # (8)!
   COMPACT_MAX_TOKENS=<number> # (9)!
   AUXILIARY_MODEL=<model> # (10)!
   VERIFY_SSL=<boolean> # (11)!
   MODELS_CONFIG=<path> # (12)!
   ```

   1. This is required to be set to `true` when deployed in an air-gapped environment.
   2. Hostnames that the backend can accept requests on.
   3. Port the server listens on. Default: `3000`
   4. Whether to listen for HTTPS requests. `false` means HTTP. `true` requires SSL certificates to be mounted into the container. Default: `false`
   5. Bind to `::` (IPv6) instead of `0.0.0.0` (IPv4). Default: `false`
   6. Full URL of the primary inference endpoint, including the completions path (e.g. `https://example.com/api/v1/chat/completions`). You can also use `INFERENCE_URL1`.
   7. Optional secondary inference endpoint. You can configure multiple endpoints by incrementing the number (e.g., `INFERENCE_URL3`, `INFERENCE_URL4`). Models are routed to one of them with `inference_index` in the [model catalog](<#model-catalog>).
   8. Enable request filtering via a lightweight LLM guardrail. Default: `true`
   9. Maximum number of tokens to be generated by the compaction process. Default: `2000`
   10. AI model used for guardrail protections and auxiliary tasks like chat title generation and context compaction. Must be a model served by the **primary** inference endpoint, named exactly as that endpoint serves it - auxiliary requests always go to `INFERENCE_URL`, regardless of the model the user selected.

       It is not recommended to have reasoning enabled for this model. A reasoning model may be slow enough for guardrail checks to time out. Default: `deepseek/deepseek-v4-flash-0731`
   11. Whether to verify the SSL certificate of the inference endpoint. Default: `true`
   12. Path to the [model catalog](<#model-catalog>) inside the container. Default: `/app/config/models.toml`
2. Create a `models.toml` file listing the AI models available to your users. See [Model Catalog](<#model-catalog>) below.
3. Run the container image with the `.env` file, mounting the model catalog:

   ```bash
   docker run -d -p 3000:3000 --env-file .env \
     -v /path/to/models.toml:/app/config/models.toml:ro \
     ghcr.io/trylynx-ai/ai-agent-for-splunk-backend:latest
   ```

   If `SSL_ENABLED=true`, mount a certificate chain and private key into the container at `/ssl/cert.pem` and `/ssl/privkey.pem`:

   ```bash
   docker run -d -p 3000:3000 --env-file .env \
     -v /path/to/models.toml:/app/config/models.toml:ro \
     -v /path/to/fullchain.pem:/ssl/cert.pem:ro \
     -v /path/to/privkey.pem:/ssl/privkey.pem:ro \
     ghcr.io/trylynx-ai/ai-agent-for-splunk-backend:latest
   ```

> [!TIP]
>
> Ensure the mounted files are readable by the container process (e.g., `chmod 644`).

### Model Catalog

The AI models offered in the Splunk app are defined on the backend, in a `models.toml` file. The app lists them in the order they appear in the file.

```toml
# models.toml

[[models]]
name = "zai-org/GLM-5.2" # (1)!
display_name = "GLM 5.2" # (2)!
reasoning_effort = "high" # (3)!
context_window = 200000 # (4)!
inference_index = 1 # (5)!

[[models]]
name = "anthropic/claude-sonnet-4.6"
display_name = "Claude Sonnet 4.6"
reasoning_effort = "medium"
context_window = 1000000
inference_index = 2
cache_control = "5m" # (6)!
max_tokens = 64000 # (7)!
```

1. Model name as served by the inference engine (e.g. vLLM or LiteLLM).
2. Name shown to users in the UI. The same model can be listed twice with the same `display_name` - once with `reasoning_effort` and once without - to offer both modes.
3. Reasoning effort sent to the inference engine (e.g. `"medium"` or `"high"`). Setting it makes this entry the reasoning ("thinking") variant of the model; omit it for the non-reasoning variant. See [Reasoning Effort](<#reasoning>). Optional.
4. Used to show the context fullness of a conversation in the UI. Not used by the backend. Optional.
5. Which inference endpoint serves this model: `1` for `INFERENCE_URL`, `2` for `INFERENCE_URL2`, and so on. Optional. Default: `1`
6. Explicit prompt caching. See [Prompt Caching](<#caching>). Optional.
7. The most tokens the model may generate in one response, reasoning included. Optional. Default: `32000`

The file is validated at startup, and the backend refuses to start if it is missing, malformed, contains unknown keys or more than one reasoning or non-reasoning entry per `display_name`, or references an inference endpoint that isn't configured. Changes apply when the backend restarts.

The file holds no secrets - API keys stay in the `INFERENCE_API_KEY` environment variables.

### Reasoning Effort

Entries without `reasoning_effort` (or set to `"none"`) send `"none"`, which explicitly turns reasoning off - some models would otherwise fall back to the provider's default reasoning.

If the inference engine or model rejects the `reasoning_effort` field altogether, set it to `"null"`: the entry is still the non-reasoning variant, but the field is not sent. Values are case-insensitive, and the actual reasoning support is determined by the inference engine.

### Prompt Caching

The backend keeps each conversation's prompt append-only, so the inference engine can reuse its cached prefix from the previous request. Engines that cache automatically - such as vLLM, SGLang, OpenAI, DeepSeek and Gemini - need no configuration.

Some providers only cache when the request marks explicit cache breakpoints. For those, set `cache_control` on the model in the catalog to `"5m"` or `"1h"`, the cache's lifetime:

- **Set it** for Claude models served through LiteLLM (Amazon Bedrock, Google Vertex AI, Anthropic) or OpenRouter, and for Qwen models through OpenRouter (`"5m"` only).
- **Leave it unset** for every other engine, including Anthropic's own OpenAI-compatible endpoint and bedrock-access-gateway (which has its own `ENABLE_PROMPT_CACHING` setting). Some engines, such as Mistral, Groq and Fireworks, reject requests that carry the markers.

`"1h"` keeps the cache through pauses longer than 5 minutes, but cache writes cost more - typically 2x the input price instead of 1.25x.

Each completed request is logged by the backend with its token counts, including cached tokens:

```text
Usage: model=... session=... prompt=... cached=... cache_write=... completion=...
```

Use it to check a model's cache hit rate. Note that vLLM only reports cached tokens with `--enable-prompt-tokens-details`, and SGLang with `--enable-cache-report`.

### Per-User Budgets

When using a backend in on-prem mode, every inference request identifies the Splunk user behind it: the Splunk username is sent in the OpenAI `user` field, and the user's Splunk roles as `splunk_role:<role>` tags in the `x-litellm-tags` header. With an LLM proxy like [LiteLLM](<https://www.litellm.ai>), your AI admins can use them to track spend and set budgets for individual users and for teams by role.

### OpenShift Container Platform (OCP)

On OpenShift, the same configuration is supplied as container `env` entries rather than an `.env` file.

Apply the following manifests with `oc apply -f`, replacing the `<YOUR-*>` placeholders with your own values.

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: lynx-ai-backend
  namespace: <YOUR-NAMESPACE>
  labels:
    app.kubernetes.io/name: lynx-ai-backend
    app.kubernetes.io/instance: lynx-ai-backend
spec:
  replicas: 1 # (1)!
  selector:
    matchLabels:
      app.kubernetes.io/name: lynx-ai-backend
      app.kubernetes.io/instance: lynx-ai-backend
  template:
    metadata:
      labels:
        app.kubernetes.io/name: lynx-ai-backend
        app.kubernetes.io/instance: lynx-ai-backend
    spec:
      containers:
        - name: lynx-ai-backend
          image: <YOUR-IMAGE> # (2)!
          ports:
            - name: http
              containerPort: 3000
              protocol: TCP
          env:
            - name: TZ
              value: <YOUR-TIMEZONE>
            - name: ONPREM_MODE
              value: 'true'
            - name: TRUSTED_HOSTS
              value: <YOUR-HOST> # (3)!
            - name: INFERENCE_URL
              value: <YOUR-INFERENCE-URL>
            - name: INFERENCE_API_KEY
              value: <YOUR-API-KEY> # (4)!
            - name: GUARDRAIL
              value: 'true'
            - name: AUXILIARY_MODEL
              value: <YOUR-AUXILIARY-MODEL>
          resources:
            requests:
              memory: 512Mi
              cpu: 500m
            limits:
              memory: 1Gi
              cpu: '1'
          securityContext:
            readOnlyRootFilesystem: true # (5)!
          volumeMounts:
            - name: models
              mountPath: /app/config # (6)!
              readOnly: true
            - name: tmp
              mountPath: /tmp
            - name: var-tmp
              mountPath: /var/tmp
      volumes:
        - name: models
          configMap:
            name: lynx-ai-models
        - name: tmp
          emptyDir:
            sizeLimit: 64Mi
        - name: var-tmp
          emptyDir:
            sizeLimit: 64Mi
```

1. The backend is stateless, so you can raise the replica count freely - nothing else needs to be scaled alongside it.
2. Full image reference, as pushed to your container registry (e.g. `registry.example.com/lynx-ai-backend:v0.13.1`).
3. Should match the hostname exposed by the route. If you let OpenShift auto-generate that hostname, create the route first and fill this in afterwards.
4. Consider storing credentials in a secret and referencing them with `valueFrom.secretKeyRef` instead of writing them directly into the manifest.
5. The backend writes nothing outside `/tmp` and `/var/tmp`, both of which are mounted below, so its root filesystem can stay read-only (optional).
6. Mount the ConfigMap as a directory, without `subPath`. The backend reads the catalog at startup, so restart the deployment after changing it (`oc rollout restart deployment/lynx-ai-backend`).

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: lynx-ai-models
  namespace: <YOUR-NAMESPACE>
  labels:
    app.kubernetes.io/name: lynx-ai-backend
    app.kubernetes.io/instance: lynx-ai-backend
data:
  models.toml: |
    [[models]]
    name = "<YOUR-MODEL-NAME>"
    display_name = "<YOUR-DISPLAY-NAME>"
    reasoning_effort = "<YOUR-REASONING-EFFORT>"
    context_window = <YOUR-CONTEXT-WINDOW>
```

```yaml
apiVersion: v1
kind: Service
metadata:
  name: lynx-ai-backend
  namespace: <YOUR-NAMESPACE>
  labels:
    app.kubernetes.io/name: lynx-ai-backend
    app.kubernetes.io/instance: lynx-ai-backend
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 3000
      targetPort: http
      protocol: TCP
  selector:
    app.kubernetes.io/name: lynx-ai-backend
    app.kubernetes.io/instance: lynx-ai-backend
```

```yaml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: lynx-ai-backend
  namespace: <YOUR-NAMESPACE>
  annotations:
    haproxy.router.openshift.io/timeout: 300s
  labels:
    app.kubernetes.io/name: lynx-ai-backend
    app.kubernetes.io/instance: lynx-ai-backend
spec:
  host: <YOUR-HOST> # (1)!
  path: /
  to:
    kind: Service
    name: lynx-ai-backend
    weight: 100
  port:
    targetPort: http
  tls:
    termination: edge
    insecureEdgeTerminationPolicy: Redirect
  wildcardPolicy: None
```

1. Omit this field to let OpenShift auto-generate a hostname from the route and namespace names.

### Monitoring

The backend exposes two unauthenticated operational endpoints, both outside the versioned API prefix:

- `/health` - Returns `{"status": "ok"}` while the backend is up.
- `/metrics` - Prometheus metrics for request rate, latency, in-progress requests, and status codes.

You should keep them reachable only from your monitoring stack.

## Splunk App

When deploying the Splunk app, point it at your backend server. From this point on, setting up the Splunk app is the same as for an internet-connected deployment.

Follow the instructions in [Installation](<https://docs.trylynx.ai/installation/index.md>) and [Configuration](<https://docs.trylynx.ai/configuration/index.md>) to complete the setup.
