Run the assistant on a server
This page is for the person who operates a Ciaren installation. If you run Ciaren on your own computer, add a key on the Connections page instead: see Providers, models and API keys.
Deployment and credentials
Ciaren settings and provider credentials belong to one server instance. Anyone with access to its API can manage the assistant within the installation's token and browser-origin rules.
- Deploy separate instances, data directories and secret sources for separate trust boundaries.
- Use TLS and the Ciaren API token for a networked installation.
- Configure reverse proxies and monitoring to omit request bodies and authorization headers.
- Restrict process and diagnostic dump access at the operating-system level.
Server-managed keys
Without a key selected on the Connections page, you can configure the assistant in the server environment. A key selected on the Connections page takes precedence.
| Variable | Meaning |
|---|---|
CIAREN_ASSISTANT_ENABLED | Default true. Set false and restart to turn the assistant off on the server, including saved keys. |
CIAREN_ASSISTANT_PROVIDER | openai, anthropic, deepseek, opencode, gemini, bedrock or off (the default). |
CIAREN_ASSISTANT_<PROVIDER>_MODEL | A listed model or a legacy ID from Providers. Use the provider name in capitals, for example CIAREN_ASSISTANT_OPENAI_MODEL. |
CIAREN_ASSISTANT_<PROVIDER>_EFFORT | Reasoning effort. Available for OpenAI, Anthropic, DeepSeek and Gemini. |
CIAREN_ASSISTANT_<PROVIDER>_KEY_SOURCE | env (default) or file. |
CIAREN_ASSISTANT_<PROVIDER>_API_KEY | The key, when the source is env. |
CIAREN_ASSISTANT_SECRET_DIR | Directory of secret files, default /run/ciaren-assistant-secrets. |
Existing server defaults have not changed (for example gpt-5-mini for OpenAI). Set the _MODEL variable to switch an environment-configured install explicitly.
Where the key comes from
| Source | Set, rotate or revoke |
|---|---|
env (default) | Inject CIAREN_ASSISTANT_<PROVIDER>_API_KEY into the server process using a deployment secret. Restart after replacing or removing it. |
file | Mount a read-only file named openai, anthropic, deepseek, opencode, gemini or bedrock inside CIAREN_ASSISTANT_SECRET_DIR. Files are read per request. Use a regular file, readable only by the service account. |
For Docker or a headless install, set the non-secret variables and mount the secret file. Keep the source file outside the repository, build context, data directory and connector roots. On shared installations, set CIAREN_STORAGE_ALLOWED_ROOTS to dedicated dataset folders.
services:
ciaren:
environment:
CIAREN_ASSISTANT_PROVIDER: openai
CIAREN_ASSISTANT_OPENAI_MODEL: gpt-6.2-sol
CIAREN_ASSISTANT_OPENAI_EFFORT: low
CIAREN_ASSISTANT_OPENAI_KEY_SOURCE: file
volumes:
- /srv/private/ciaren/openai:/run/ciaren-assistant-secrets/openai:roFor the repository Compose setup, save the fragment as docker-compose.override.yml alongside docker-compose.yml. Set the host path to an existing secret file and recreate the service with docker compose up -d --build ciaren.
For process injection, set the key source to env and have your secret manager supply CIAREN_ASSISTANT_<PROVIDER>_API_KEY to the server process, for example CIAREN_ASSISTANT_DEEPSEEK_API_KEY for DeepSeek. Keep secrets out of shell history and committed environment files.
Revoke compromised keys in the provider console as well. Status checks do not contact the provider: a configured status means Ciaren found the key, not that the provider accepts it.
Google Gemini and AWS Bedrock variables
- Gemini:
CIAREN_ASSISTANT_PROVIDER=geminiwithCIAREN_ASSISTANT_GEMINI_MODELandCIAREN_ASSISTANT_GEMINI_API_KEY, or a mountedgeminifile. - Bedrock:
CIAREN_ASSISTANT_PROVIDER=bedrockwithCIAREN_ASSISTANT_BEDROCK_MODELandCIAREN_ASSISTANT_BEDROCK_API_KEY, or a mountedbedrockfile.
How keys are protected
The server removes CIAREN_ASSISTANT_*_API_KEY variables from its environment at startup and from run worker processes, so flow code cannot read them from the environment.
This does not protect a key from a Python Transform node. That node runs with the server's privileges and can read the key wherever it is stored: server memory, a mounted secret file or the OS keychain. CIAREN_EXECUTION_MODE=process keeps the keys out of the run worker's environment and settings, but it does not stop code from reading the keychain or a mounted file.
On a shared installation, allow only trusted users to edit flows, and use a provider key with a spending limit. See Advanced setup.
Usage and cost
Every reply, including one that ends without a change, shows the provider calls and tokens it used. Input tokens include the part the provider read from its prompt cache, and output tokens include the part spent on reasoning, when the provider reports them. Providers usually bill cached input at a lower rate. Once a conversation has more than one reply, the panel also shows its total.
Ciaren does not convert tokens to a price, because rates differ by provider, model and account. For a currency cap, set a spend limit in the provider console.
Hourly limits
CIAREN_ASSISTANT_TURNS_PER_HOUR(default 60) allows that many provider calls per rolling hour in each application process. It counts calls, not turns: a turn reserves its calls when it starts and returns the unused ones when it ends. A complex Build can use all 14, so the default allows about four of them an hour. Raise the limit if you need more.CIAREN_ASSISTANT_TOKENS_PER_HOURalso caps tokens. It is unset by default.- Requests use zero automatic retries. Cancelling a turn does not return its reserved calls.
Concurrency and memory
- Up to eight turns can be active per process.
- Up to 64 proposals live in memory for three minutes. Use a single process or sticky routing so a proposal confirmation reaches the process that holds it.
- The opening request is at most 12 KB. Older tool results can be compacted to keep each call within its 48 KB limit. Anthropic, Gemini and Bedrock preserve earlier messages instead of compacting signed history, and stop at the same size limit.
- A single slow node step can overrun the 15-second check deadline.
Per-request limits are in What the assistant can build. The activity endpoint handles confirmed edits separately from model tools and never provides history to the model.