Skip to main content
AI Backend GlossaryGlossary

Celery Worker

A Python background task processor for long-running async jobs.

Definition

Celery is a Python distributed task queue. Celery workers are processes that pick up tasks from a broker (usually Redis or RabbitMQ) and execute them asynchronously, independent of the web server. This allows you to offload long-running operations — like LLM inference, document processing, or email sending — without blocking HTTP threads.

Why it matters for AI APIs

LLM chains can take 30+ seconds. Running them in your HTTP handler blocks the thread, exhausts your web server's concurrency, and causes timeouts. Celery workers handle these jobs asynchronously, returning an immediate job ID to the client and processing the work independently.

In FastAPI AI Kit

FastAPI AI Kit ships Celery configured with Redis as the broker. The docker-compose includes a worker container. `@celery.task` decorator is ready to use. Job status is queryable via `GET /v1/jobs/{job_id}` using the built-in status endpoint.

Related terms