AI Worker Operations
AI Worker runs bounded, explicitly installed workloads outside the Artemis server. The worker has no database connection, repository credentials or incoming HTTP server. It connects to Redis or Valkey through Artemis' distributed-data provider. Artemis core uses the same provider. Workload-specific authorization and persistence remain in the owning feature; Hyperion owns exercise generation and its teaching-quality review.
Deployment topology
A VM is not required. A dedicated worker host or VM is recommended for production isolation. A single-host installation can run the worker as a separate process with its own unprivileged rootless Docker daemon, subject to the checks below.
| Environment | Recommended placement | Required separation |
|---|---|---|
| Staging | Dedicated worker host or separate process | Separate provider access, image qualification, model credentials and budgets from production |
| Production | Dedicated worker host or VM | Keep core, database, LocalVC and exam-critical build services outside the worker execution environment |
| Small test installation | Separate worker process on the same host | Dedicated rootless Docker daemon; no shared core/build-agent socket, credentials or repository mounts |
The supervisor's Docker socket grants control over its daemon. A rootful daemon
can also grant host-level authority; putting its supervisor in an unprivileged
container does not remove that authority. For a host-only installation, use a
dedicated unprivileged worker account and rootless daemon. Verify that cgroup
resource limits apply, generated-code containers have network none, and the
worker cannot access the core/build-agent Docker socket or application data.
Leave generation disabled if these controls cannot be established.
Rootless containers still share the host kernel. They do not provide the same isolation as a separate VM or host. Include that residual risk in the deployment review, especially when the host also serves core or grading workloads.
Generated-code containers use network none, a read-only root filesystem, dropped
capabilities, no-new-privileges, and bounded CPU, memory, processes and writable
scratch mounts. They never receive the Docker socket or provider credentials.
Restrict supervisor egress to approved provider, model, registry and telemetry endpoints.
The worker does not load the core Langfuse exporter.
Configure approved worker telemetry explicitly.
Block database, repository/NFS, management and cloud-metadata access.
Distributed-data access
Set artemis.distributed-data.provider: Redis on every core and worker and configure the same Redis or Valkey
endpoint and credentials. Choose a distinct client name starting with artemis- for each process. See
provider configuration.
A worker runs in its own JVM and cannot receive commands through process-local state.
Keep the store on a private network reachable only by trusted Artemis processes. A loopback port mapping on the host
still permits other containers on the same bridge to reach the store at its container address.
The worker JVM can read
and write shared coordination data, so isolate the worker host and protect its
credentials.
Generated-code containers still have network none and never receive provider
credentials. A provider outage stops new admission and delivery; do not treat a
missing heartbeat as proof that a job completed. Commands expire after two minutes;
failed command admission has bounded retry. Unacknowledged execution events and
their chunks do not expire. They remain until the core callback succeeds.
Acknowledgement tombstones expire after four hours. The event inbox limits
outstanding payloads to 256 MiB per worker; a full inbox stops publication rather
than deleting evidence. Restore delivery before capacity is exhausted.
Monitor the provider's memory, persistence and connection health.
Do not mix worker and core transport versions during this change. Drain active jobs before upgrading both processes; an old process can still write expiring events or read acknowledgement records from the previous storage layout.
Core configuration
Enable coordination only on a core node. The worker pool is independent of whether
Hyperion is enabled:
artemis:
aiworker:
enabled: true
ids: [worker-1]
presence-ttl: PT30S
lease-ttl: PT45S
Use the same authoritative DistributedDataProvider and worker configuration on all
coordinators. Presence and slot reservations have explicit lifetimes. A claim is bound to execution UUID, worker incarnation, slot, workload
schema/profile and immutable image. Stale events cannot release a replacement claim.
Workload resource identifiers are opaque to AI Worker.
For Hyperion, all exercise writers must additionally satisfy its
coordination and recovery requirements.
Redis/Valkey is not a disposable cache: use synchronous AOF (appendonly yes,
appendfsync always, no-appendfsync-on-rewrite no) and maxmemory-policy noeviction.
Automatic asynchronous failover is not qualified for ownership-sensitive persistence.
Never flush or replace the store under running writers.
Worker configuration
Build the normal Artemis WAR once per release with ./gradlew -Pprod -Pwar bootWar.
Use the same WAR for core nodes, build agents, and AI Workers. There is no separate
worker WAR.
Run AI Workers from the normal Artemis image of the release (ghcr.io/ls1intum/artemis:<version>),
as for Build Agents, with the Spring profiles prod,aiworker. Disable the image's HTTP
health check, because a worker has no HTTP server, and give the container 8 GB of
memory: the image fixes a 5 GB maximum heap. The worker starts the
normal ArtemisApp in a separate process. It uses the normal Artemis component scan.
Profiles and feature conditions select AI Worker services and the configured workload.
The aiworker profile disables server modules, the HTTP server, and database services.
The selected distributed-data provider supplies the shared client.
Startup rejects core, localci, localvc, and buildagent with aiworker,
and rejects any attempt to turn the HTTP server back on. Do not run this profile
on a core node. Keep the core container away from the worker's Docker socket.
Like the build agents' default build images, the sandbox has its own toolchain version.
The shipped default is ghcr.io/ls1intum/artemis-hyperion-sandbox:java25-2.
The worker reuses the local image if present and pulls it only when missing. Before accepting jobs,
it resolves the reference to an immutable local image ID. Registry access is not needed to reuse a cached image.
An Artemis upgrade can keep using the same sandbox version; no image is selected from the Artemis commit.
Configuration files containing secrets must be readable only by the deployment account
and worker UID, and mounted read-only.
spring:
main:
web-application-type: none
data:
redis:
host: ${REDIS_HOST}
username: ${REDIS_USERNAME}
password: ${REDIS_PASSWORD}
client-name: artemis-worker-1
artemis:
distributed-data:
provider: Redis
aiworker:
id: worker-1
# Optional: override the shipped toolchain version for a private registry or custom image.
# image: registry.example/hyperion-sandbox@sha256:<digest>
max-concurrent-executions: 1
runtime: runc
memory-bytes: 2147483648
cpu-quota: 200000
pids: 256
heartbeat-interval: PT10S
connection-grace: PT45S
shutdown-timeout: PT2M
Leave image unset for normal deployments, including local and pull-request Artemis builds.
An override can be a versioned tag, a registry digest or a local SHA-256 image ID.
Use a new version when changing the toolchain; do not overwrite published version tags.
The environment-based entry point also accepts AI_WORKER_ID and AI_WORKER_SANDBOX_IMAGE.
The workload defaults to hyperion-generation, schema 1, profile java-gradle; set
artemis.aiworker.workload and artemis.aiworker.profile only for another installed workload. Configure provider access through
Spring properties or a protected, read-only configuration mount.
A mounted Spring configuration can supply the corresponding properties directly.
Each process selects one installed workload capability and one image. Scale different workloads/profiles with separate worker identities. An identifier does not install an implementation: unsupported combinations advertise no usable capacity. This keeps image, resource policy and credentials operator-controlled, not selectable by models or jobs.
The shipped workload is hyperion-generation, schema 1, profile java-gradle.
Give the worker the same artemis.llm block as core, as described in
LLM configuration. Core sends the name of the preset with each run.
Hyperion generation sends model requests from the worker process directly to the
configured provider. Core sends the assignment and receives evidence through the
distributed-data provider; it does not proxy generation model requests.
Other workloads do not need model credentials unless their implementation uses a model.
Presets for exercise generation need max-retries: 0, so that every provider call is counted. Content telemetry stays off unless explicitly approved.
Capacity and administration
Open Administration → Monitoring → AI Generation. The page is available when either
whole-exercise generation is enabled or artemis.aiworker.enabled=true starts
worker coordination for another workload. For Hyperion, there is no third
enablement switch: an eligible generation core starts worker coordination
automatically. The Administration → Configuration → Features page shows the Hyperion and
whole-exercise generation settings. The AI Generation page shows worker
capacity. These are startup settings, not runtime switches.
If coordination is disabled, the status endpoint returns 404 and the view reports that
status is unavailable rather than claiming an empty healthy pool.
| Column | Meaning |
|---|---|
| Worker | Stable worker name |
| State | Available, running, starting, not ready, or offline |
| Free / total slots | Current capacity; unavailable workers do not contribute free slots |
| Last contact | Time core received the latest accepted heartbeat |
| Running jobs | Executions reported by the worker; unknown when offline |
Like Build Agents, the page loads an initial REST snapshot and receives updates over
admin-only WebSocket topics. The scheduling node publishes watched snapshots every
five seconds; there is no browser polling loop. The last-updated time and manual
refresh remain available. Failed requests are marked rather than presenting stale
data as healthy. Monitoring requires the standard scheduling profile on a core node.
Active generations show the exercise, owner, worker, start time, and whether a run is running, saving, or being canceled. Use the exercise link to open its administration page. The cancel action opens a confirmation dialog. Cancellation applies to the exact run and requires an audit reason.
Worker monitoring remains available without Hyperion; a worker-status outage does
not disable generation cancellation. Transport identifiers, capability schema versions,
and image digests remain available through GET /api/aiworker/admin/workers for incident
investigation, rather than occupying the everyday overview.
Budget memory and CPU for the worker JVM plus every concurrent sandbox. The slot range is 1–16, default 1. Increasing slots does not relax per-execution resource limits, feature budgets or provider rate limits. Keep the worker grace interval above heartbeat spacing and core's reservation lifetime longer than presence lifetime.
Maintenance and failure handling
- Stop new workload admission and wait for active executions and pending deliveries to finish.
- Confirm the workload's persistence/restore operations have also finished; worker idleness alone does not prove core has stopped writing.
- Stop the worker with a container stop timeout longer than its two-minute shutdown budget.
- Deploy matching core, worker, provider access and image configuration; then verify readiness.
- Run a workload canary before reopening admission.
Protocol 7 uses neutral envelopes, explicitly versioned workload capabilities and LLM presets named by core. It is incompatible with earlier wire protocols. Drain and stop old workers, reconcile their containers under the old ownership labels, and change provider configuration together. Do not keep old and new workers sharing an identity.
Cancellation and lost coordinator renewals stop only the exact execution. Reliable accounting/checkpoint events precede completion; failed delivery keeps the slot occupied while that worker is alive. A worker process loss is not a durable local outbox or an exactly-once execution guarantee. Core fences stale incarnations; each workload decides whether a retained result is usable and whether persistence requires operator recovery.
Ansible and staging qualification
The ls1intum.artemis.ai_worker role deploys the supervisor on a dedicated host or VM
with rootful Docker and no user-namespace remapping. It uses the same valkey map
as core and Build Agents. Configure it on all three roles.
Set artemis_aiworker_ids on eligible core nodes. Hyperion generation starts worker
coordination automatically; set artemis_aiworker_enabled only for coordination
without Hyperion generation.
The role validates inputs, protects rendered secrets and preloads a configured sandbox image; otherwise the worker pulls the published one. It does not provision the provider, firewall or isolation boundary, or drain jobs. Stop new admission and drain active work and persistence before replacing a worker. Shared-host rootless deployment requires separate provisioning outside this role.
Before staging admission, verify provider reachability and access control, image digests, Docker runtime, store durability, worker capability and capacity. Then exercise successful completion, cancellation, worker restart/lost renewals, capacity exhaustion and workload-specific persistence/undo. Test with the deployment's intended distributed provider. Promote the same qualified artifacts and configuration shape to production with separate secrets.