VelocityLLM
An API server that sits in front of an LLM engine and decides which requests to accept, in what order, and how many to run at once, so that answers arrive inside a time promise (an SLA) instead of everything slowing down together.
It ships with:
static: a fixed number of requests at a time, first come first served. A simple baseline.dynamic: watches the waiting line, the time promise and GPU memory, changes how many requests run at once, and says "no" early (with a reason) when an answer cannot arrive in time.- A mock engine, so you can try everything on a normal computer with no GPU.
- Test-traffic tools and a benchmark service for comparing the policies.
Install
pip install velocityllm
This installs the server, the mock engine and the tools. It does not install vLLM, because vLLM needs an NVIDIA GPU. For real models:
pip install "velocityllm[gpu]"
Requires Python 3.11 or newer.
Quick start (no GPU)
velocityllm serve --policy dynamic --mock --port 8000
In a second terminal:
curl -X POST http://localhost:8000/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello", "max_tokens": 20}'
curl http://localhost:8000/stats
The mock engine returns made-up text at a realistic speed. It is for trying the scheduler, not for real answers.
Real model on a GPU
pip install "velocityllm[gpu]"
velocityllm serve --policy dynamic --model-path /path/to/model --sla-ms 8000
You need an NVIDIA GPU and the model files on disk (a folder with config.json and the weights).
Commands
| Command | What it does |
|---|---|
velocityllm serve |
Runs the scheduler server (--policy static or dynamic, --mock, --sla-ms, --port ...) |
velocityllm loadgen |
Sends test traffic to a running server (--num-requests, --pattern, --mixed-prompts ...) |
velocityllm arena |
Runs the benchmark service behind the Arena dashboard. Only the API is included in this package; the web page is in the repository |
Add --help to any command to see all options.
API
| Endpoint | Purpose |
|---|---|
POST /generate |
Send a prompt, get an answer, with queue time and whether the SLA was met |
POST /generate/stream |
Same, as a stream of tokens |
POST /v1/completions |
OpenAI-style completions |
GET /stats |
Live numbers: active, queued, accepted, rejected, latency percentiles |
GET /metrics |
The same numbers in Prometheus format |
GET /health |
Is the server alive |
A request the scheduler cannot serve in time is refused with HTTP 429 and a reason.
Good to know
- Results depend on your GPU, model and traffic. Test on your own setup before relying on any policy.
- Only a normal computer is needed for the mock engine; the real-GPU path needs NVIDIA hardware and model weights.
- This is an early release (version 0.1).
Source and issues
Metadata
Release files for velocityllm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| velocityllm-0.1.0.tar.gz | 122.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| velocityllm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 231.2 kB
Release files / velocityllm-0.1.0.tar.gz
| Download URL | velocityllm-0.1.0.tar.gz |
|---|---|
| Size | 122.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3002e2def22dce1180abd88ff6eeecaed87faa473f131e896186c2eadc54739e
|
|
BLAKE2b-256 checksum How to use checksums |
620b7cff2a4f1f774629a2fc0f1bbbff57145b0e7793ba04bda36bb0673a3998
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.4
|
Release files / velocityllm-0.1.0-py3-none-any.whl
| Download URL | velocityllm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 108.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55ff1f8ffd1fd00fb45ac0b21268e847c975d2632a2b4f0bff6c9989356a6f84
|
|
BLAKE2b-256 checksum How to use checksums |
672da678b615b595112cbf138e5ea051f3c1c51f35a0584d8a2bb943f6807931
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.4
|