> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quivr.thevibecompany.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Quivr in production

> Set up shared services, configure API and worker processes, and check readiness.

Run the API and workers as separate services so you can add search capacity and background processing capacity independently. Use the [one-machine bundle](https://docs.quivr.thevibecompany.co/operate/install.md) for a Compose evaluation.

## Prerequisites

You need a platform that can run the API and worker and execute a one-time migration job. Choose a [verified release image](https://docs.quivr.thevibecompany.co/operate/security.md#verify-release-images) for Linux amd64. Provision the shared services on a private network and choose the plugins your application needs.

API replicas handle requests while workers handle background jobs. Both use the same backing services.

![A TLS proxy fronts the API. API and worker replicas share PostgreSQL, Temporal, Weaviate, S3 storage and plugins.](https://mintcdn.com/thevibecompany/brOOeQQUNito1EOq/images/diagrams/quivr-production.png?fit=max\&auto=format\&n=brOOeQQUNito1EOq\&q=85\&s=8749c0878766812c930557e0ebafecc0)

| Service | Role |
| - | - |
| PostgreSQL | Stores documents, versions, operations and change history. Use a writable primary. |
| Temporal | Schedules and retries background jobs. Workers poll it for tasks. |
| Weaviate | Stores the search index. |
| S3-compatible storage | Holds original files and derived artifacts. |
| Plugins | Provide ingestion and retrieval. Add readers, connectors, rerankers and alert evaluators as needed. |

See the [first-party plugin catalog](https://docs.quivr.thevibecompany.co/plugins.md) and [pin your plugins](https://docs.quivr.thevibecompany.co/operate/manage-plugins.md#pin-a-plugin). Choose how to run [EmbeddingGemma 2](https://docs.quivr.thevibecompany.co/operate/vector-model.md) before pinning inference. The engine runs on CPU. The [embedding plugin](https://docs.quivr.thevibecompany.co/plugins/multimodal-embed.md) needs an inference endpoint for document embeddings. The one-machine bundle supplies a CPU text service. Railway can also run an optional local CPU query encoder on the API, while document embeddings still use the configured provider. The shipped [Modal deployment](https://github.com/The-Vibe-Company/quivr/blob/main/deploy/modal/README.md) uses GPU for image embedding and GPU rerankers.

## Configure the engine

Set `QUIVR_CONFIG` to the path of an engine JSON file. Give the migrator, API and workers matching dependency addresses, plugin pins and secrets. Set `temporal_address`, `weaviate_url`, and the `s3` endpoint and bucket in the file. Pin an ingestion and a retrieval plugin for the API. The worker needs an ingestion plugin.

| Required engine input | How to supply it |
| - | - |
| PostgreSQL connection | `DATABASE_URL` or `database_url` in JSON |
| Object storage credentials | `S3_ACCESS_KEY` and `S3_SECRET_KEY`, or the corresponding `s3` fields |
| Stable cursor signing key | `QUIVR_CURSOR_KEY` or `cursor_key` |
| Scoped API keys | `QUIVR_API_KEYS` or `keys` |
| Plugin signing rings | `QUIVR_ENGINE_PLUGIN_KEYS` when the pins require signed requests |

The [secret bindings](https://docs.quivr.thevibecompany.co/reference/configuration.md#secret-bindings) describe mounted files and optional settings such as `QUIVR_CREDENTIAL_KEY`, `WEAVIATE_API_KEY`, and dedicated `QUIVR_ADMIN_KEYS`. For signed plugins, give each plugin only its own verification ring in `QUIVR_PLUGIN_SIGNING_KEYS`. See [signed engine requests](https://docs.quivr.thevibecompany.co/reference/plugin-protocol.md#signed-engine-requests).

### Railway environment

The [Railway entrypoint](https://github.com/The-Vibe-Company/quivr/blob/main/deploy/railway/core-entrypoint.py) generates the JSON. Supply the database, cursor and S3 secrets above and set `TEMPORAL_ADDRESS`, `WEAVIATE_URL`, `S3_ENDPOINT`, and `TEI_URL`. The wrapper requires an HTTP(S) URL in `TEI_URL` when building configuration. For EmbeddingGemma 2, set `QUIVR_DEMO_EMBEDDING=gemma`, the provider’s HTTPS origin in `EMBED_URL`, and its bearer token in `EMBED_API_KEY`. On a fresh deployment, set `QUIVR_DEMO_CORE_INGEST=0` so only the EmbeddingGemma 2 ingestion plugin is pinned.

Supply `QUIVR_API_KEYS` or the wrapper's individual key variables, starting with `QUIVR_API_KEY`. Optional settings include `WEAVIATE_GRPC_ADDRESS`, `QUIVR_WORKER_QUEUES`, and the per-queue slot limits. Set `QUIVR_RECORD_QUERY_TEXT=0` for private queries in the Railway deployment. See the [Railway deployment guide](https://github.com/The-Vibe-Company/quivr/blob/main/deploy/railway/README.md) for its service setup and the optional local query encoder.

## Run the image

Mount the JSON read-only and make it readable by UID/GID `10001`. Use `listen` for API traffic and `probe_listen` for private health checks and metrics. To route to ports inside the containers, bind the listeners to container-reachable addresses such as `0.0.0.0:8080` and `0.0.0.0:8081`. Place the API behind your [TLS proxy](https://docs.quivr.thevibecompany.co/operate/security.md#secure-the-network).

1. Start the backing services and plugins. Follow the [PostgreSQL prerequisites](#use-dba-managed-postgresql) for an external database and size each dependency using the [infrastructure profiles](https://github.com/The-Vibe-Company/quivr/blob/main/deploy/infrastructure.md).
2. Run `quivr migrate` with the new configuration and wait for it to exit successfully. It prepares the database, object store and index. The Railway API wrapper runs this step at startup. Railway workers wait up to 10 minutes for pending database migrations before they can become ready.
3. Start `quivr api` and `quivr worker` and give each process access to its configuration, secrets and dependencies. Restart the processes when changing their JSON settings.

### Use DBA-managed PostgreSQL

Use a dedicated PostgreSQL 17 database on the writable primary. Use the same non-superuser login for migration, API and workers. Grant it `CONNECT` on the database, `USAGE` and `CREATE` on the `public` schema, and `USAGE` on `plpgsql`. Set its database-specific `search_path` to `public`. If the DBA removed the `plpgsql` extension, install it before granting access.

Keep Quivr's objects in `public` and owned by that login so migrations and background maintenance can modify them. When switching an existing database to a new login, have the DBA verify object ownership first. The `postgres_prerequisite` diagnostic identifies startup and migration grant failures.

### Run first-party plugin images

Use the verified digest from the release's `images.txt`. First-party plugin images are named `ghcr.io/the-vibe-company/quivr-plugin-<id>`, using the manifest ID. Run the plugin on the private network and pin its endpoint and manifest in the engine's `plugins` list. See [Pin a plugin](https://docs.quivr.thevibecompany.co/operate/manage-plugins.md#pin-a-plugin).

For [EmbeddingGemma 2](https://docs.quivr.thevibecompany.co/plugins/multimodal-embed.md), [prepare the pinned tokenizer](https://github.com/The-Vibe-Company/quivr/blob/main/plugins/multimodal-embed/README.md#prepare-a-matching-tokenizer) using the `--hosted` option in `scripts/prepare_tokenizer.py` and mount the tokenizer file read-only at `/tokenizer/tokenizer.json`. Set `tokenizer.python` to `/opt/tokenizer/bin/python` and `tokenizer.model` to the mounted path.

Run the image's `configure` command with that model configuration and save the generated manifest. Mount it at `/app/quivr-plugin.yaml` in the serving container. Use the same manifest and the exact configuration object in the engine pin's `manifest` and `configuration` fields. Give provider credentials to the plugin through the secret environment declared by its manifest. See the [container commands](https://github.com/The-Vibe-Company/quivr/blob/main/plugins/multimodal-embed/README.md#run-the-tokenizer-in-the-published-image).

## Check that it is ready

On the private probe address of each API and worker instance, request `GET /readyz`. HTTP 204 means ready. A 503 response or an unreachable probe calls for a check of startup logs, migration status and service connectivity. The worker also checks Temporal, S3 and Weaviate. Test [ingestion](https://docs.quivr.thevibecompany.co/guides/add-content.md) and [search](https://docs.quivr.thevibecompany.co/guides/search.md) before sending production traffic. Those requests exercise the plugins. The worker probe port opens after the schema check. Configure startup checks to allow the full `migration_wait` plus dependency startup time before liveness checks can restart a waiting worker.

To confirm which release is running, check the startup log for the version and revision. The private `/metrics` endpoint also exposes `quivr_build_info`.

## Diagnose slow searches during imports

Repeat a [search](https://docs.quivr.thevibecompany.co/guides/search.md) in lexical, semantic and hybrid modes during an import. Compare the response's `usage.phases.index_query_ms` with the `weaviate.request` spans for its `X-Trace-ID`. The spans end at response headers. The API timing includes reading and decoding the response and selecting passages. Compare search latency and import throughput before changing [index capacity](https://docs.quivr.thevibecompany.co/operate/scale.md).

The keyword leg of lexical and hybrid search caps the main passage scan at 2,400 passage objects per candidate round. Requests that fetch passage text have a 16 MiB response limit per window. The search can refill once at twice the initial candidate depth, up to 2,400 candidates. These bounds can omit matches and change hybrid ordering, especially when many candidates lack passages from the active ingestion plugin.

## Scale workers on backlog

Workers can serve `live`, `bulk`, or both queues. Separate them to give live work its own capacity during imports. Watch `quivr_queue_waiting_documents` and `quivr_queue_oldest_waiting_age_seconds` on private probes. The readings represent the whole installation. Aggregate replicas with `max`. Check [capacity and backlog](https://docs.quivr.thevibecompany.co/operate/scale.md) before adding replicas, especially if shared services are already saturated.

### The quivr-autoscaler binary

The experimental `quivr-autoscaler` polls the queue API and adjusts one target service. Run one controller per target and set replica bounds based on dependency capacity. Set `QUIVR_QUEUE_URL` to the full private `/v0/admin/queues` endpoint. Set `QUIVR_QUEUE_KEY` to a dedicated key, distinct from API and operator keys, with only `queues:read` and `corpora: ["*"]`. See [API key scopes](https://docs.quivr.thevibecompany.co/reference/configuration.md#api-keys).

For Railway, follow the [autoscaler setup](https://github.com/The-Vibe-Company/quivr/blob/main/deploy/railway/autoscaler/README.md).

## Next

* [Secure Quivr](https://docs.quivr.thevibecompany.co/operate/security.md) before opening access.
* [Upgrade Quivr](https://docs.quivr.thevibecompany.co/operate/upgrade.md) with a rollback window.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.