Skip to main content

Redis

Redis is the job, queue, and state backend for the Code Interpreter. Its REDIS_* keys in config/.env, persistence, the connection URL, and links to the official Redis docs.

Redis is the job/queue and state backend for the Code Interpreter (codeapi). It coordinates sandbox execution and holds session/cache state used by the codeapi services.

Overview

Compose fileconfig/codeapi.compose.yml (bundled with the code interpreter)
Service nameredis (container intelliask-redis)
Image variableREDIS_IMAGE (e.g. redis:7-alpine)
Exposedinternal only
Databind-mounted at ${STORAGE_ROOT}/redis → /data
Consumed bythe codeapi services via REDIS_HOST / REDIS_PORT

Environment variables

Redis's settings use the REDIS_ prefix in config/.env:

VariableDefaultWhat it does
REDIS_IMAGEredis:7-alpineImage + tag to run.
REDIS_CPUS0.25CPU ceiling.
REDIS_MEMORY96mMemory ceiling.
REDIS_HOSTredisHost the codeapi services connect to.
REDIS_PORT6379Port the codeapi services connect to.
REDIS_PASSWORD(empty)Password, if the Redis instance requires one.

Where the Redis connection is consumed

The REDIS_HOST / REDIS_PORT / REDIS_PASSWORD keys are read by the Code Interpreter services, not by Redis itself. Keep the host/port (redis:6379) in sync with this service.

After editing any REDIS_* value, apply with:

intelliask up redis

Persistence

Redis data is bind-mounted at ${STORAGE_ROOT}/redis, so cache/session state survives container restarts. The Code Interpreter treats Redis as hot storage and archives longer-lived generated files to S3, so a Redis reset only loses in-flight sessions — not stored files. For durability tuning (RDB snapshots vs AOF), see the official persistence guide below.

Resource limits

The defaults (REDIS_CPUS=0.25, REDIS_MEMORY=96m) suit the Code Interpreter's coordination workload. If you run a large warm pool or heavier workloads, give Redis more memory and watch docker stats.

Updating Redis

# 1. Bump the tag in config/.env, e.g. REDIS_IMAGE=redis:7.4-alpine
# 2. Pull + recreate only Redis
intelliask update redis

Official documentation

Last updated on