Skip to main content

Komus Tasks Server

Production-grade task execution server with web UI, webhooks, scheduling, and multi-task support.

Installation

First public PyPI release: 1.0.0.

pip install ko-tasks-server

Quick Start

Start the server

ko-tasks-server takes no flags — configure it with environment variables:

export PORT=3000
export BASE_PATH=/var/lib/ko-tasks-server
export API_KEYS=your-api-key
export ADMIN_API_KEYS=your-admin-key
ko-tasks-server

Access

Endpoint Description
http://localhost:3000/ui Komus Tasks Console (default dashboard)
http://localhost:3000/ui-old Legacy htmx web dashboard
http://localhost:3000/docs OpenAPI Documentation
http://localhost:3000/health Health Check
http://localhost:3000/metrics Prometheus Metrics

Configuration

Environment Variables

Variable Default Description
PORT 3000 Server port
BASE_PATH ./data Base path for data storage
API_KEYS — Comma-separated API keys for client auth
ADMIN_API_KEYS — Comma-separated admin API keys
STORAGE_TYPE file Record/database backend: file or elasticsearch
FILE_STORAGE_TYPE local File storage backend: local or s3
LOG_LEVEL INFO Logging level

S3 Storage (optional)

export FILE_STORAGE_TYPE=s3
export S3_BUCKET=my-task-artifacts
export S3_REGION=eu-west-1
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...

Elasticsearch (optional)

export STORAGE_TYPE=elasticsearch
export ELASTICSEARCH_HOSTS=http://localhost:9200

Deployment

Docker

docker build -t ko-tasks-server .
docker run -p 3000:3000 \
  -e API_KEYS=your-key \
  -e ADMIN_API_KEYS=your-admin-key \
  -v ./data:/data \
  ko-tasks-server

Docker Compose

docker-compose up -d

Pre-configured variants:

  • docker-compose.yml — Basic setup
  • docker-compose.elasticsearch.yml — With Elasticsearch
  • docker-compose.cloud.yml — Cloud-ready with S3
  • docker-compose.standalone.yml — Standalone mode

API Overview

Task Management (Admin)

# Deploy a task
curl -X POST http://localhost:3000/admin/tasks \
  -H "X-Admin-API-Key: your-admin-key" \
  -F "file=@my-task-1.0.0.zip"

# List deployed tasks
curl http://localhost:3000/admin/tasks \
  -H "X-Admin-API-Key: your-admin-key"

Thread Execution

# Create and run a thread
curl -X POST http://localhost:3000/threads \
  -H "X-API-Key: your-key" \
  -H "X-App-Id: my-app" \
  -H "X-User-Id: user-1" \
  -H "Content-Type: application/json" \
  -d '{"mode": "sync", "inputs": [{"kind": "text", "text": "Hello"}]}'

# Get thread status
curl http://localhost:3000/threads/{thread_id} \
  -H "X-API-Key: your-key"

# Pause/Resume
curl -X POST http://localhost:3000/threads/{thread_id}:pause \
  -H "X-API-Key: your-key"
curl -X POST http://localhost:3000/threads/{thread_id}:resume \
  -H "X-API-Key: your-key"

Webhooks

# Create a webhook
curl -X POST http://localhost:3000/webhooks \
  -H "X-Admin-API-Key: your-admin-key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/task-events",
    "events": ["thread.succeeded", "thread.failed"],
    "secret": "webhook-signing-secret"
  }'

Schedules

# Create a schedule
curl -X POST http://localhost:3000/schedules \
  -H "X-Admin-API-Key: your-admin-key" \
  -H "Content-Type: application/json" \
  -d '{
    "task_id": "my-task",
    "cron": "0 8 * * MON",
    "timezone": "Europe/Paris",
    "inputs": [{"kind": "text", "text": "Weekly run"}]
  }'

Features

  • Multi-task deployment with isolated code + venv per task
  • Worker subprocess isolation with JSON Lines IPC
  • Progress, pause, resume, cancel — cooperative task control
  • Python & Node.js task runtimes
  • Web Dashboard — full CRUD for all resources
  • Webhook system — HMAC-signed, scoped, with delivery tracking
  • Cron scheduling — with concurrency policies
  • Artifact management — local or S3 storage
  • Credential vault — AES-encrypted secret storage
  • Prometheus metrics — request counts, durations, thread states
  • Idempotency — duplicate request detection

Development

# Clone and setup
git clone https://github.com/Komus-ai/ko-tasks-platform.git
cd ko-tasks-platform
uv sync

# Run server tests
uv run --package ko-tasks-server pytest packages/server/tests/ -v

# Start dev server
uv run --package ko-tasks-server python -m komus_tasks_server.server

License

MIT

Release files for ko-tasks-server 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ko-tasks-server 1.0.0
File Size Uploaded
ko_tasks_server-1.0.0.tar.gz 594.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ko-tasks-server 1.0.0
File Interpreter ABI Platform
ko_tasks_server-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / ko_tasks_server-1.0.0.tar.gz

Download URL ko_tasks_server-1.0.0.tar.gz
Size 594.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4321e71535f92655e82c0dfa3049b4a6175db930a0f0f6f9734c50e31d6cd314
BLAKE2b-256 checksum
How to use checksums
75ce67fc73bb857439d5fd3fe38e0dc4b8bad9784c6f449fa136461dfd0e15b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ko_tasks_server-1.0.0-py3-none-any.whl

Download URL ko_tasks_server-1.0.0-py3-none-any.whl
Size 724.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b298097e6545067beae7e07d96d4c4128a9206b8e0feaf453211ef2e0e84b896
BLAKE2b-256 checksum
How to use checksums
e7c7d45604d6c18a6257473b8c2097efa7e9e252817969a45e75368d420723c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page