300+ Tools CoveredSource Data Updated Weeklydates

mosec

Mosec puts a trained model behind an online API. The web layer and task coordination are written in Rust, while the code you write stays purely Python, in the same form you use for offline testing. The project describes its scope narrowly: do the online serving part well, and leave model optimization and business logic to you. You run the result yourself, in your own container on your own machines.

Visit mosec →
Type
Model Serving
Category

By Egor Burlakov · Edited · Source dates below

Snapshot

Scroll sideways to see all columns. With a keyboard, focus this table and use the arrow keys.

Buying facts for mosec, as captured on 10 November 2026

AttributeDetail

License

Apache-2.0

How you install it

PyPI package with pip install -U mosec on Linux or macOS, or conda-forge, or pixi; building from source needs Rust and make package

Runtime requirement

Python 3.7 or above

How you write a service

Subclass mosec.Worker, override forward, then append the worker to a Server with the number of processes to spawn

Batching control

Dynamic batching set per worker with max_batch_size and max_wait_time in milliseconds; the batch is collected when either the count or the wait time is reached

Deployment

Official GPU base image mosecorg/mosec; the service should be PID 1 in the container and needs no Gunicorn or NGINX, though an ingress controller can be added when necessary

Observability and shutdown

Prometheus monitoring metrics for batch size, batch duration, processing duration, remaining tasks and throughput; graceful shutdown on SIGINT or SIGTERM

Cost basis

Apache-2.0 software you install into your own container image; what you pay for is the CPU/GPU machines and the orchestration you run it on

Our take

The fit is clearest for a Python team that already owns GPUs and wants more work out of the same hardware. The two levers the project points at are batching and stage separation: split preprocessing and inference into CPU and GPU stages, then adjust the worker count in each stage to keep the GPU busy. Both are worker configuration rather than new serving code. If you would rather someone else run the endpoint, weigh what mosec leaves to you instead: building and operating the container image, and tuning max_batch_size and max_wait_time against your GPU memory from the metric histograms. That operational work is what buys the control.

Evaluate mosec

Where it stands out

  • Rust handles the web layer and task coordination with async I/O, while the user-facing interface is purely Python and framework-agnostic.

  • Dynamic batching aggregates requests from different users for batched inference, with two explicit knobs instead of a hidden policy.

  • Workers can be chained into pipelined stages for mixed CPU/GPU/IO workloads, with data passed between stages by inter-process communication and worker counts set per stage.

  • Cloud operation is designed in rather than added later: the project targets Kubernetes or any container orchestration system, so the warmup, shutdown and monitoring behaviour comes from the framework instead of wrapper scripts you maintain.

  • OpenAPI documentation is served at /openapi/swagger/ and, since v0.9.8, is generated for all Worker implementations without TypedMsgPackMixin; HTTP/2 from the client is adapted to automatically since v0.8.8.

  • Ready-to-use examples cover multi-route serving, an OpenAI compatible embedding service, reranking, shared memory IPC, customized GPU allocation, customized metrics and compression.

Trade-offs to weigh

  • Tuning is your job. The docs warn that inference at max_batch_size must not cause out-of-memory on the GPU, and that max_wait_time should normally be less than the batch inference time; the metric histograms of real batch size and duration are the inputs you work from.

  • Container discipline is assumed. The service controls multiple processes, so it should be PID 1; running anything else alongside it in the same container means adding a supervisor such as Supervisor or Horust.

  • Multi-stage services pay a data cost: values crossing stages are serialized and deserialized, so extremely large data might make the whole pipeline slow. The docs suggest you could enable shared memory, via RedisShmIPCMixin, to potentially reduce that latency.

  • JSON is the default for decoding requests and encoding responses, and the docs note images and embeddings are not well supported by it; binary payloads mean inheriting MsgpackMixin or another mixin.

  • Without a warm-up example the first request's latency is expected to be longer, and when one is set the service is only ready after that example has been forwarded through the handler, which lengthens every start and restart.

Public signals

About these signals

Verified factual signals from public sources. They indicate observable activity or interest, not total adoption, product quality, or cost.

18 GitHub commits 90d904 GitHub stars

See all signals from 2 sources
Source
Signals
Last updated
GitHub
Commits 90d:18Stars:904
November 9, 2026
PyPI
Weekly downloads:907
November 9, 2026