gen-worker
A library used to build custom functions in Cozy Creator's serverless function platform.
Decision gist · record as of 2026-08-14
Yes, if you are building endpoints for Cozy's platform or need a framework that abstracts GPU orchestration and model management. The SDK is actively maintained, has low install friction, permissive licensing, and zero known vulnerabilities. It is production-ready for inference and training workloads. Not suitable if you need to deploy to other serverless platforms or prefer manual device management.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.12 or later.
- For model inference with PyTorch, install gen-worker[torch].
- Local testing requires uv; never pip install globally as it shadows the working tree.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2026-08-14 (0 days) · last repo commit 2026-08-14
0 known vulnerabilities (OSV.dev, 2026-08-14) · 88,489 downloads/mo, #13,725 on PyPI
Alternatives
Verify before relying
pip install gen-worker
from gen_worker import RequestContext, endpoint
import msgspec
class Input(msgspec.Struct):
prompt: str
@endpoint
def echo(ctx: RequestContext, payload: Input) -> str:
return f"got: {payload.prompt}"
# Run locally: gen-worker run --payload '{"prompt": "hello"}'- Whether the platform's profiling gate for VRAM measurement works reliably across different GPU types and model sizes.
- How well the per-request state isolation (ctx.for_request) scales under high concurrency.
- Whether optional extras ([images], [audio], [video], [vision]) are fully documented and stable.
What it is and what it does
gen-worker is a Python SDK for building serverless endpoints that run on Cozy's managed worker pool. You write a single decorated function or class, and the SDK handles the infrastructure: model discovery and download from HuggingFace, Civitai, or other sources; GPU device placement and low-VRAM offload; request scheduling and cancellation; file I/O and streaming; and reporting back to the control plane. It abstracts away device management entirely—endpoint code never touches `.to("cuda")` or offload configuration.
The package supports both simple stateless endpoints (a decorated function) and stateful ones (a class with setup() and handler methods). It includes bindings for popular model sources (HF, Hub, Civitai, ModelScope), optional support for PyTorch inference and training, media I/O for images, audio, and video, and streaming via async generators. Local development is supported through a CLI (gen-worker run, serve, invoke, prefetch) for testing before deployment. The SDK is actively maintained, requires Python 3.12+, and has no known vulnerabilities.
Use it for
- Deploy a text-to-image model (e.g., Stable Diffusion XL) as a managed endpoint with automatic GPU placement and VRAM optimization.
- Build a lightweight API proxy endpoint that routes requests to external services without needing GPU resources.
- Create a model conversion pipeline that ingests checkpoints, quantizes them to fp8, and publishes them to the hub.
- Develop a streaming inference endpoint (e.g., token-by-token LLM generation) using async generators.
- Run multi-model endpoints where users select a checkpoint at request time via a ModelChoice enum.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building endpoints for Cozy's platform or need a framework that abstracts GPU orchestration and model management.
The SDK is actively maintained, has low install friction, permissive licensing, and zero known vulnerabilities. It is production-ready for inference and training workloads. Not suitable if you need to deploy to other serverless platforms or prefer manual device management.
Install
gen-worker on PyPI
Before you install
Low friction install with a pure-Python wheel. Active maintenance with a release on 2026-08-14. Requires Python 3.12 or later. Twelve runtime dependencies including grpcio, huggingface-hub, and protobuf suggest a mature, production-oriented codebase.
Requires Python 3.12 or later. For model inference with PyTorch, install gen-worker[torch]. Local testing requires uv; never pip install globally as it shadows the working tree.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install gen-worker
from gen_worker import RequestContext, endpoint
import msgspec
class Input(msgspec.Struct):
prompt: str
@endpoint
def echo(ctx: RequestContext, payload: Input) -> str:
return f"got: {payload.prompt}"
# Run locally: gen-worker run --payload '{"prompt": "hello"}'
Verify before relying
- Whether the platform's profiling gate for VRAM measurement works reliably across different GPU types and model sizes.
- How well the per-request state isolation (ctx.for_request) scales under high concurrency.
- Whether optional extras ([images], [audio], [video], [vision]) are fully documented and stable.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 12 packagesblake3c2pa-pythonggufgrpciohashrepohuggingface-hubmsgspecprotobufpsutilpyyamlrequeststomli-w |
| Maintenance | Actively maintained 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,489 / month, #13,725 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: gen_worker-0.116.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “serverless endpoint framework”
- gen-workerA Python SDK for writing serverless endpoints that run on Cozy's…
- runpodRunpod is a Python SDK and API client library for interacting with…
- functions-frameworkA lightweight FaaS framework that lets you write portable Python…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also runpod · torchx · temporalio · pydocket · kfp · bounded-pool-executor · bentoml · outerbounds · dagster-cloud · nominal