downshift-server 0.5.0__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {downshift_server-0.5.0 → downshift_server-1.0.0}/.gitignore +8 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/CHANGELOG.md +117 -0
- downshift_server-1.0.0/PKG-INFO +335 -0
- downshift_server-1.0.0/README.md +283 -0
- downshift_server-1.0.0/docs/README.md +52 -0
- {downshift_server-0.5.0/docs/code-docs → downshift_server-1.0.0/docs}/adapters.md +8 -6
- downshift_server-1.0.0/docs/architecture.md +148 -0
- downshift_server-1.0.0/docs/cli.md +257 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/docs/compatibility.md +29 -10
- {downshift_server-0.5.0/docs/code-docs → downshift_server-1.0.0/docs}/http-api.md +164 -46
- downshift_server-1.0.0/docs/openai.md +111 -0
- downshift_server-1.0.0/docs/openapi.json +1874 -0
- downshift_server-1.0.0/docs/production.md +346 -0
- {downshift_server-0.5.0/docs/code-docs → downshift_server-1.0.0/docs}/python-api.md +85 -41
- downshift_server-1.0.0/docs/reference/http.md +5 -0
- downshift_server-1.0.0/docs/reference/python.md +21 -0
- downshift_server-1.0.0/docs/requirements.txt +4 -0
- downshift_server-1.0.0/docs/serving.md +166 -0
- downshift_server-1.0.0/docs/stability.md +153 -0
- downshift_server-1.0.0/docs/walkthrough.md +202 -0
- downshift_server-1.0.0/examples/grafana-dashboard.json +251 -0
- downshift_server-1.0.0/llms.txt +63 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/pyproject.toml +33 -23
- {downshift_server-0.5.0 → downshift_server-1.0.0}/scripts/gen_matrix.py +10 -3
- downshift_server-1.0.0/src/downshift/__init__.py +196 -0
- downshift_server-1.0.0/src/downshift/__main__.py +3 -0
- downshift_server-1.0.0/src/downshift/_defaults.py +5 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/_version.py +1 -1
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/adapters/_flatten.py +4 -11
- downshift_server-1.0.0/src/downshift/adapters/base.py +29 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/adapters/embedding.py +27 -63
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/adapters/generic.py +4 -7
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/adapters/hf.py +25 -41
- downshift_server-1.0.0/src/downshift/adapters/pooling.py +3 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/adapters/pyg.py +14 -19
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/adapters/registry.py +13 -20
- downshift_server-1.0.0/src/downshift/adapters/text.py +6 -0
- downshift_server-1.0.0/src/downshift/cli/entry.py +21 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/cli/main.py +174 -175
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/cli/options.py +120 -11
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/cli/render.py +69 -35
- downshift_server-1.0.0/src/downshift/cli/runtime.py +266 -0
- downshift_server-1.0.0/src/downshift/core/axes.py +81 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/core/capture.py +55 -61
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/core/export_cache.py +98 -36
- downshift_server-1.0.0/src/downshift/core/feeds.py +51 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/core/manifest.py +15 -27
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/core/memo.py +45 -70
- downshift_server-1.0.0/src/downshift/core/phase.py +21 -0
- downshift_server-1.0.0/src/downshift/core/rows.py +163 -0
- downshift_server-1.0.0/src/downshift/core/shapes.py +188 -0
- downshift_server-1.0.0/src/downshift/core/verdict.py +420 -0
- downshift_server-1.0.0/src/downshift/core/verify.py +372 -0
- downshift_server-1.0.0/src/downshift/entities/__init__.py +22 -0
- downshift_server-1.0.0/src/downshift/entities/adapters.py +152 -0
- downshift_server-1.0.0/src/downshift/entities/axes.py +42 -0
- downshift_server-1.0.0/src/downshift/entities/backend.py +33 -0
- downshift_server-1.0.0/src/downshift/entities/cache.py +60 -0
- downshift_server-1.0.0/src/downshift/entities/cli.py +91 -0
- downshift_server-1.0.0/src/downshift/entities/loading.py +46 -0
- downshift_server-1.0.0/src/downshift/entities/metrics.py +93 -0
- {downshift_server-0.5.0/src/downshift/serve → downshift_server-1.0.0/src/downshift/entities}/options.py +43 -8
- downshift_server-1.0.0/src/downshift/entities/phase.py +29 -0
- downshift_server-1.0.0/src/downshift/entities/requests.py +47 -0
- downshift_server-1.0.0/src/downshift/entities/serving.py +164 -0
- downshift_server-1.0.0/src/downshift/entities/signatures.py +25 -0
- downshift_server-1.0.0/src/downshift/entities/verdict.py +230 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/hf_repo.py +24 -64
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/loading.py +15 -66
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/logs.py +4 -13
- downshift_server-1.0.0/src/downshift/serve/__init__.py +92 -0
- downshift_server-1.0.0/src/downshift/serve/app.py +552 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/serve/backends.py +81 -106
- downshift_server-1.0.0/src/downshift/serve/cached.py +257 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/serve/codec.py +7 -15
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/serve/describe.py +24 -59
- downshift_server-1.0.0/src/downshift/serve/encode.py +159 -0
- downshift_server-1.0.0/src/downshift/serve/engine.py +572 -0
- downshift_server-1.0.0/src/downshift/serve/errors.py +127 -0
- downshift_server-1.0.0/src/downshift/serve/feeds.py +247 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/serve/graphs.py +19 -38
- downshift_server-1.0.0/src/downshift/serve/metrics.py +118 -0
- downshift_server-1.0.0/src/downshift/serve/middleware.py +197 -0
- downshift_server-1.0.0/src/downshift/serve/numerics.py +61 -0
- downshift_server-1.0.0/src/downshift/serve/openai.py +139 -0
- downshift_server-1.0.0/src/downshift/serve/parse.py +137 -0
- downshift_server-1.0.0/src/downshift/serve/predict.py +120 -0
- downshift_server-1.0.0/src/downshift/serve/result_cache.py +129 -0
- downshift_server-1.0.0/src/downshift/serve/reuse.py +74 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/serve/schemas.py +59 -57
- downshift_server-1.0.0/src/downshift/serve/stages.py +64 -0
- downshift_server-1.0.0/src/downshift/settings.py +288 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/sources.py +11 -22
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/conftest.py +47 -15
- downshift_server-1.0.0/tests/models/cross_row.py +24 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_adapters.py +52 -2
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_axes.py +32 -7
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_binary_io.py +10 -13
- downshift_server-1.0.0/tests/test_capture.py +193 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_cli.py +385 -35
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_describe.py +2 -2
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_embedding.py +34 -30
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_engine.py +260 -22
- downshift_server-1.0.0/tests/test_errors.py +236 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_export.py +66 -13
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_export_cache.py +167 -36
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_export_pyg.py +7 -13
- downshift_server-1.0.0/tests/test_fixtures.py +69 -0
- downshift_server-1.0.0/tests/test_gen_openapi.py +36 -0
- downshift_server-1.0.0/tests/test_gpu.py +74 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_graph_batching.py +7 -5
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_hf.py +65 -25
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_hf_text.py +48 -41
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_loading.py +2 -1
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_logs.py +73 -5
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_manifest.py +6 -10
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_memo.py +34 -26
- downshift_server-1.0.0/tests/test_metrics.py +279 -0
- downshift_server-1.0.0/tests/test_openai.py +466 -0
- downshift_server-1.0.0/tests/test_openai_sdk.py +95 -0
- downshift_server-1.0.0/tests/test_package.py +99 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_path_privacy.py +1 -1
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_render.py +145 -31
- downshift_server-1.0.0/tests/test_result_cache.py +204 -0
- downshift_server-1.0.0/tests/test_rows.py +166 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_schemas.py +1 -1
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_serve.py +179 -46
- downshift_server-1.0.0/tests/test_serve_boot.py +170 -0
- downshift_server-1.0.0/tests/test_serve_cache.py +662 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_serve_hardening.py +125 -27
- downshift_server-1.0.0/tests/test_settings.py +340 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_shapes.py +22 -5
- downshift_server-1.0.0/tests/test_stability.py +51 -0
- downshift_server-0.5.0/tests/test_prevalidated.py → downshift_server-1.0.0/tests/test_verdict.py +56 -9
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_verify_internals.py +171 -34
- downshift_server-0.5.0/.gitattributes +0 -5
- downshift_server-0.5.0/.github/workflows/ci.yml +0 -76
- downshift_server-0.5.0/.github/workflows/compatibility-matrix.yml +0 -35
- downshift_server-0.5.0/.github/workflows/release.yml +0 -96
- downshift_server-0.5.0/PKG-INFO +0 -633
- downshift_server-0.5.0/README.md +0 -583
- downshift_server-0.5.0/bench/BLOG_APPENDIX_v0.4.0.md +0 -200
- downshift_server-0.5.0/bench/README.md +0 -185
- downshift_server-0.5.0/bench/REPORT_v0.4.0.md +0 -563
- downshift_server-0.5.0/bench/__init__.py +0 -1
- downshift_server-0.5.0/bench/_path.py +0 -73
- downshift_server-0.5.0/bench/cases.py +0 -247
- downshift_server-0.5.0/bench/factories.py +0 -39
- downshift_server-0.5.0/bench/hf_models.py +0 -300
- downshift_server-0.5.0/bench/inproc.py +0 -163
- downshift_server-0.5.0/bench/large/__init__.py +0 -1
- downshift_server-0.5.0/bench/large/bert_small.py +0 -27
- downshift_server-0.5.0/bench/large/cnn_large.py +0 -39
- downshift_server-0.5.0/bench/large/mlp_large.py +0 -34
- downshift_server-0.5.0/bench/loadgen.py +0 -111
- downshift_server-0.5.0/bench/naive_hf_server.py +0 -83
- downshift_server-0.5.0/bench/report.py +0 -517
- downshift_server-0.5.0/bench/results/v0.5.0/REPORT.md +0 -495
- downshift_server-0.5.0/bench/results/v0.5.0/chart_runs.csv +0 -1006
- downshift_server-0.5.0/bench/results/v0.5.0/chart_stages.csv +0 -369
- downshift_server-0.5.0/bench/results/v0.5.0/results.json +0 -23212
- downshift_server-0.5.0/bench/results/v0.5.0/results_hf.json +0 -3264
- downshift_server-0.5.0/bench/results_hf_tuned_minilm_v0.4.0.json +0 -391
- downshift_server-0.5.0/bench/results_hf_tuned_pg_v0.4.0.json +0 -219
- downshift_server-0.5.0/bench/results_hf_v0.4.0.json +0 -1390
- downshift_server-0.5.0/bench/results_v0.4.0.json +0 -11905
- downshift_server-0.5.0/bench/run.py +0 -580
- downshift_server-0.5.0/bench/servers.py +0 -136
- downshift_server-0.5.0/docs/code-docs/README.md +0 -56
- downshift_server-0.5.0/docs/code-docs/cli.md +0 -219
- downshift_server-0.5.0/docs/code-docs/serving.md +0 -393
- downshift_server-0.5.0/docs/production.md +0 -248
- downshift_server-0.5.0/src/downshift/__init__.py +0 -197
- downshift_server-0.5.0/src/downshift/__main__.py +0 -3
- downshift_server-0.5.0/src/downshift/adapters/base.py +0 -62
- downshift_server-0.5.0/src/downshift/adapters/pooling.py +0 -19
- downshift_server-0.5.0/src/downshift/adapters/text.py +0 -72
- downshift_server-0.5.0/src/downshift/cli/runtime.py +0 -249
- downshift_server-0.5.0/src/downshift/core/axes.py +0 -130
- downshift_server-0.5.0/src/downshift/core/feeds.py +0 -28
- downshift_server-0.5.0/src/downshift/core/inputs.py +0 -25
- downshift_server-0.5.0/src/downshift/core/phase.py +0 -48
- downshift_server-0.5.0/src/downshift/core/prevalidated.py +0 -127
- downshift_server-0.5.0/src/downshift/core/shapes.py +0 -209
- downshift_server-0.5.0/src/downshift/core/verdict.py +0 -480
- downshift_server-0.5.0/src/downshift/core/verify.py +0 -445
- downshift_server-0.5.0/src/downshift/serve/__init__.py +0 -113
- downshift_server-0.5.0/src/downshift/serve/app.py +0 -525
- downshift_server-0.5.0/src/downshift/serve/engine.py +0 -599
- downshift_server-0.5.0/src/downshift/serve/middleware.py +0 -28
- downshift_server-0.5.0/src/downshift/serve/predict.py +0 -620
- downshift_server-0.5.0/src/downshift/serve/reuse.py +0 -151
- downshift_server-0.5.0/src/downshift/settings.py +0 -181
- downshift_server-0.5.0/tests/test_adapter_discovery_gating.py +0 -56
- downshift_server-0.5.0/tests/test_capture.py +0 -87
- downshift_server-0.5.0/tests/test_cli_startup.py +0 -46
- downshift_server-0.5.0/tests/test_demo.py +0 -41
- downshift_server-0.5.0/tests/test_fixtures.py +0 -45
- downshift_server-0.5.0/tests/test_inputs.py +0 -13
- downshift_server-0.5.0/tests/test_main_module.py +0 -18
- downshift_server-0.5.0/tests/test_package.py +0 -24
- downshift_server-0.5.0/tests/test_review3_misc.py +0 -343
- downshift_server-0.5.0/tests/test_serve_boot.py +0 -96
- downshift_server-0.5.0/tests/test_settings.py +0 -148
- {downshift_server-0.5.0 → downshift_server-1.0.0}/LICENSE +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/examples/__init__.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/examples/clean_mlp.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/examples/data_dependent_branch.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/examples/scatter_include_self_false.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/_imports.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/adapters/__init__.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/cli/__init__.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/core/__init__.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/src/downshift/py.typed +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/__init__.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/__init__.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/bf16_weights.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/broken_factory.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/clean_mlp.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/custom_autograd.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/data_dependent_branch.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/dict_input.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/dropout_model.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/dynamic_batch_cnn.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/gnn_gat.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/gnn_gcn.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/gnn_output_kinds.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/gnn_sage.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/hf_repo.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/scatter_include_self_false.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/tied_weights.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/models/tiny_bert.py +0 -0
- {downshift_server-0.5.0 → downshift_server-1.0.0}/tests/test_gen_matrix.py +0 -0
|
@@ -10,6 +10,7 @@ build/
|
|
|
10
10
|
|
|
11
11
|
# Virtual environments
|
|
12
12
|
.venv/
|
|
13
|
+
.venv-gpu/
|
|
13
14
|
venv/
|
|
14
15
|
ENV/
|
|
15
16
|
env/
|
|
@@ -37,6 +38,7 @@ Thumbs.db
|
|
|
37
38
|
*.onnx.data
|
|
38
39
|
artifacts/
|
|
39
40
|
tmp/
|
|
41
|
+
*.pem
|
|
40
42
|
|
|
41
43
|
# Local tooling config
|
|
42
44
|
.claude/
|
|
@@ -51,3 +53,9 @@ scripts/.validation/
|
|
|
51
53
|
# checkpoints (GBs) and ad-hoc output are not. See bench/README.md.
|
|
52
54
|
bench/models/
|
|
53
55
|
bench/scratch/
|
|
56
|
+
# The torch vs ONNX Runtime study: kept local, not published (2026-11-07).
|
|
57
|
+
bench/torch_vs_ort.py
|
|
58
|
+
bench/results/v0.6.0/torch_vs_ort*.json
|
|
59
|
+
|
|
60
|
+
# Docs build
|
|
61
|
+
site/
|
|
@@ -3,6 +3,123 @@
|
|
|
3
3
|
All notable changes to this project are documented here. Format follows
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## 1.0.0 - 2026-11-24
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- A documentation site on Read the Docs (`https://downshift-server.readthedocs.io`). MkDocs builds it from `docs/` with `mkdocs.yml` and `.readthedocs.yaml`. It has two new reference pages: the HTTP API from the OpenAPI document (`docs/openapi.json`, which `scripts/gen_openapi.py` writes, and a test checks), and the Python API from the docstrings. `pyproject.toml` has a `Documentation` URL. The release workflow builds the site with `--strict` before the PyPI upload, and then starts the Read the Docs build of `stable`.
|
|
11
|
+
- `docs/architecture.md` and `docs/walkthrough.md`: a map of the project (the flow, the layers, the design rules, a glossary) and a guided tour with commands to run and code to read. `CONTRIBUTING.md`: set up, the checks, the rules and the recipes for a change.
|
|
12
|
+
- `scripts/check_real_models.py` and the weekly workflow `real-models.yml`. The script runs `downshift check` on public real models (embedding models, a classifier, a reranker, a PyG GCN) and writes the "Tested real models" table in `docs/compatibility.md` and the raw results in `bench/results/v1.0.0/real_models.json`. The workflow does not commit. It fails if a model FAILED or crashed.
|
|
13
|
+
- `--root-path`, `--forwarded-allow-ips` and `--timeout-graceful-shutdown` (and `DOWNSHIFT_ROOT_PATH`, `DOWNSHIFT_FORWARDED_ALLOW_IPS`, `DOWNSHIFT_TIMEOUT_GRACEFUL_SHUTDOWN`) for a server behind a proxy. `--root-path` sets the prefix that the proxy strips, so `GET /` and `GET /schema` show the right URLs. `--forwarded-allow-ips` sets the proxies whose `X-Forwarded-*` headers downshift trusts. `--timeout-graceful-shutdown` (default `30` seconds, `0` = no limit) is the time that the server waits for running requests after `SIGTERM`. `GET /ready` now gives `503` with `{"ready": false, "phase": "stopping"}` as soon as the server gets `SIGTERM` or `SIGINT`, so a load balancer drains the instance. `stopping` is a new value of `phase`. Refer to "Behind a proxy" and "Shut down" in `docs/production.md`.
|
|
14
|
+
- A serving check on a GPU. The verdict is made on the CPU. When the server serves on ONNX Runtime CUDA or on torch `cuda`, it now replays the inputs of all verification samples (the edge shapes too) through the serving backend at boot, and compares the result with the CPU result of the same model (with the tolerance of the verdict, and the cosine check for an embedding model). The `GPU check` row of the banner and the new `serving_numerics` field of `GET /metadata` show the result. If the check fails, the server logs one `WARNING` and serves torch instead, as for a DEGRADED verdict (unless you pass `--backend onnxruntime` or `--force-onnx`). The check is at boot only. Refer to "GPU" in `docs/production.md`.
|
|
15
|
+
- `--tf32` and `DOWNSHIFT_TF32`: allow TF32 math on the GPU. It is off by default. ONNX Runtime CUDA uses TF32 by default, so downshift now sets `use_tf32` to `0` for it, and sets `allow_tf32` to `False` for torch, unless you pass `--tf32`. With `--tf32`, the serving check uses the tolerances `DOWNSHIFT_TOL_TF32_ATOL` (`1e-3`) and `DOWNSHIFT_TOL_TF32_RTOL` (`1e-2`), which are experimental.
|
|
16
|
+
- A cosine check for text embedding models. At export, downshift computes the cosine similarity between each torch row and each ONNX Runtime row of the embedding. If the smallest value is lower than `DOWNSHIFT_TOL_COSINE` (default `0.9999`), the verdict is `DEGRADED`. The `atol` and `rtol` check stays. The verdict has the new field `numerics.min_cosine` (`null` for other models), and the `Numerics` row of the banner shows it. `DOWNSHIFT_TOL_COSINE` is experimental. The request path does not change.
|
|
17
|
+
- A result cache. A row that arrives a second time skips the model. It is on by default and keeps 100 rows in each worker. `--result-cache-rows N` (or `DOWNSHIFT_RESULT_CACHE_ROWS`) sets the number of rows. `0` turns it off. The cache counts rows and not bytes. The key of a row is a 256-bit BLAKE2b hash of its input. A row enters the cache on its second arrival. Two requests for the same new row run the model one time. A request in which all rows hit makes no inference. A request with some hits runs only the other rows. Each `/predict` response has `X-Downshift-Cache: hit | partial | miss`. With `--server-timing`, `Server-Timing` has a `cache` stage. `Cache-Control: no-cache` skips the lookup. `/metadata` has a `cache` block. `/predict/graph` does not use the cache. Refer to "Result cache" in `docs/production.md`. Read its warning for servers with more than one tenant: a hit is faster than a miss. A request that waits for a row of another request ends at `--request-timeout` (`503`).
|
|
18
|
+
- A row check. At export, downshift runs two different rows alone and together, on ONNX Runtime and on torch. The verdict has `row_independent` and `row_reason`. The `Rows` row of the banner and of the `check` report shows them. `/metadata` and `check --json` have them too. A model whose rows depend on each other (for example `x - x.mean(0)`, or token-level outputs) is not independent. The check also covers padding for text models: a left-padded BERT row changes in a mixed batch, and the check finds this. The check uses two rows. It cannot prove that a small effect is absent. If the numerics check failed, it does not run.
|
|
19
|
+
- `--server-timing` and `DOWNSHIFT_SERVER_TIMING` add the `Server-Timing` header to each predict response. It is off by default. Refer to `docs/cli.md`.
|
|
20
|
+
- `--metrics` and `DOWNSHIFT_METRICS` add `GET /metrics`: request counts, latency histograms, stage histograms, queue gauges and cache counters in the Prometheus text format. It is off by default. It needs one worker, and each series has the label `worker="0"`. `examples/grafana-dashboard.json` is a Grafana dashboard for the series. Refer to "Metrics" in `docs/production.md`.
|
|
21
|
+
- `DOWNSHIFT_CACHE_HEADER` sets the name of the result-cache header (default `X-Downshift-Cache`).
|
|
22
|
+
- `DOWNSHIFT_REQUEST_ID_HEADER` sets the name of the request-ID header (default `X-Request-Id`). The server reads the ID from this header and sets it on each response, also on a `500`. If the name is not a valid header name, downshift does not start, and the error says what to use. Refer to `docs/cli.md`.
|
|
23
|
+
- A stable `code` field on each error body: `{"detail": "...", "code": "text_too_long"}`. `detail` does not change. The list of codes (`invalid_request`, `invalid_input`, `missing_input`, `text_too_long`, `unknown_prompt`, `text_not_supported`, `not_graph_model`, `unauthorized`, `body_too_large`, `unsupported_media_type`, `not_found`, `method_not_allowed`, `http_error`, `not_ready`, `at_capacity`, `request_timeout`, `internal_error`, and the three codes below) does not change in 1.x. The `404`, `405` and `422` of FastAPI have a code too. Refer to "Error codes" in `docs/http-api.md`.
|
|
24
|
+
- `GET /v1/models`, `GET /v1/models/{id}` and `GET /version`. The model name is the last part of the model path. `--served-model-name NAME` (or `DOWNSHIFT_SERVED_MODEL_NAME`) sets another name. Refer to "Model name" in `docs/production.md`.
|
|
25
|
+
- `POST /v1/embeddings`, the OpenAI embeddings route, for a text embedding model. It takes `model`, `input` (a string or a list of strings), `encoding_format` (`float` or `base64`) and `user` (ignored). It has the same admission, body limit, timeout, result cache and row check as `/predict`. `usage.prompt_tokens` counts the tokens that are not padding, also for the rows that the cache serves. A text that is too long is a `400` and downshift never cuts it. `dimensions` is a `400` for now.
|
|
26
|
+
- On `/v1/*`, an error body has the OpenAI shape: `{"error": {"message", "type", "param", "code"}}`. The `code` is the downshift error code. The other routes keep `{"detail", "code"}`.
|
|
27
|
+
- `--matryoshka` and `DOWNSHIFT_MATRYOSHKA`: tell downshift that the model was trained for Matryoshka cuts. `POST /v1/embeddings` then accepts `dimensions`. It keeps the first values of each vector and scales the vector to unit length. The result cache keeps the full vector, so one entry serves all sizes. A `dimensions` outside 1 to the vector width is a `400` (`invalid_input`, `param` `dimensions`). Without the option, `dimensions` is a `400` (`dimensions_not_supported`).
|
|
28
|
+
- `--server-timing` also works on `POST /v1/embeddings`.
|
|
29
|
+
- Three error codes: `model_not_found` (`404`), `not_embedding_model` (`400`) and `dimensions_not_supported` (`400`). Refer to "Error codes" in `docs/http-api.md`.
|
|
30
|
+
- `docs/stability.md` lists the public surface that 1.0 freezes: the routes, the headers, the error codes, the metrics, the options, the exit codes, the `DOWNSHIFT_*` variables, `downshift.__all__`, the `Adapter` protocol and the manifest. It defines a breaking change and the deprecation rule: a deprecated item stays for one minor release, with a warning in the log and a `CHANGELOG.md` entry. A test checks that the page names each variable, public name, error code and metric.
|
|
31
|
+
- `format_version: 1` in `model.manifest.json` and in the export cache (each entry manifest and `index.json`). If a manifest or an index has another version (or none), downshift does not use it. It writes one warning and exports again. `index.json` now holds `{"format_version", "digests"}`: the first boot with an old index makes the digests again.
|
|
32
|
+
- `build_app` is now in `downshift.__all__`: `from downshift import build_app`. It imports lazily, so `import downshift` stays light. Refer to `docs/python-api.md`.
|
|
33
|
+
- `docs/stability.md` has a section "Experimental". These items can change in a 1.x minor release, with a note in this file: the `Adapter` protocol and `Prepared`, the `DOWNSHIFT_TOL_*` variables, `--execution`, `--axis-max`, `--middleware`, the header-name variables (`DOWNSHIFT_CACHE_HEADER` and `DOWNSHIFT_REQUEST_ID_HEADER`), the `Server-Timing` stage names and the value of the metrics label `worker`.
|
|
34
|
+
- The README has a quick start with no clone (a `model.py` file and three commands), the install steps for the CPU build of torch and for a GPU, a note on the result cache and the row check, and the section "When not to use downshift". It says that 1.0 has no container image (images come in 1.1) and that there are no chat or completions routes.
|
|
35
|
+
- `docs/production.md` and `examples/grafana-dashboard.json`: the queue-full alert is off when `--max-queue` is `0`, and the 5xx ratio leaves out `/health` and `/ready`. `docs/openai.md` says that the default model name of an import spec is the whole spec.
|
|
36
|
+
- The docs say that the default verification samples are synthetic (random values at the edge shapes). To verify on inputs like real traffic, use `--vary`.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- Breaking change: the request ID, the access log and the metrics counters are three separate pieces. Before, one middleware did all three, and it was always on. Now the request ID and the metrics are off by default, and the access log is on by default. `--enable-request-id-headers` (or `DOWNSHIFT_ENABLE_REQUEST_ID_HEADERS`) turns on the request ID: downshift reads `X-Request-Id`, sets it on each response, and puts it in the log lines and in the body of a `500`. Without it, there is no `X-Request-Id` header and no `request_id` in a `500` body, and the access log line has no `request_id`. `--no-access-log` and `--metrics` did not change. With the request ID, the access log and the metrics all off, the server has no request middleware. `build_app` has the new argument `request_id_headers`. `DOWNSHIFT_REQUEST_ID_HEADER` has an effect only with `--enable-request-id-headers`. The class `RequestIdMiddleware` now only handles the ID. A new `RequestObserverMiddleware` runs the access log and the metrics, and a server installs it only if one of them is on.
|
|
41
|
+
- Breaking change: `--fp16` and `check(fp16=True)` now convert the fp32 ONNX graph to fp16. They no longer export a `.half()` torch model. The converted graph keeps fp32 inputs and outputs, so a client sends and receives float32 and `/schema` shows float32. Before, the graph had fp16 inputs and outputs. The weights are fp16, and ONNX Runtime keeps the operations that fp16 would break in fp32. The verdict compares the graph with the fp32 torch model, with the `float16` tolerances. The torch backend of such a verdict serves the model in fp32. The model of the caller is not copied or changed. The export cache key already holds `fp16`, so an old fp16 entry does not match. If ONNX Runtime has no CPU kernel for an fp16 operation, the verdict is `FAILED` and the reason says to export without `--fp16`, or to use a newer ONNX Runtime. The `--fp16` help text now says the same as this entry: it changes the fp32 graph to fp16 weights after the export. The serving check on a GPU, and `intake` with `--reference`, use the `float16` tolerances for a graph with fp16 weights.
|
|
42
|
+
- Breaking change: the floors of `numpy` (now `2.0`; numpy 1.x is no longer supported), `fastapi` (now `0.115`), `uvicorn` (now `0.30`) and `pydantic` (now `2.5`, the first version with Python 3.12 support). `fastapi` 0.100 and `uvicorn` 0.23 failed the type check of the `floor` job. The floor of `typer` is now `0.19` (it was `0.12`; typer 0.18 and earlier import rich at load time, which the CLI must not do), the floor of `orjson` is now `3.10.7` (orjson 3.9 cannot serialize float16 numpy arrays), and the floor of the `gnn` extra `torch-geometric` is now `2.7` (it was `2.5`; the `EdgeIndex` of 2.5 fails under `torch.export` of torch 2.8). The `floor` CI job pins each of these, so CI proves each declared minimum.
|
|
43
|
+
- Breaking change: the floor of `torch` is now `2.8` (it was `2.5`), the floor of `onnx` is now `1.23` (it was `1.16`), the floor of `onnxruntime` is now `1.20` (it was `1.17`), and the floor of the `hf` extra `transformers` is now `5.17` (it was `4.40`). CI tests only these floors. torch 2.7 and earlier, onnx before 1.23, onnxruntime before 1.20, and transformers before 5.17 are no longer supported. Reasons: torch 2.6 and 2.7 cannot export a Hugging Face encoder up to its position limit (`torch.export` raises `Constraints violated (seq)`); torch 2.8 writes IR version 10 graphs, which onnxruntime 1.17 cannot load; onnxruntime 1.18 has no CPU kernel for `ArgMax(13)`, which last-token pooling needs; downshift uses only the dynamo exporter (`torch.onnx.export(dynamo=True)`), so no legacy exporter limits the `onnx` version. To upgrade, install torch 2.8 or later, onnx 1.23 or later and onnxruntime 1.20 or later, and transformers 5.17 or later if you use the `hf` extra. There is no upper cap.
|
|
44
|
+
- The trove classifier is `Development Status :: 5 - Production/Stable`.
|
|
45
|
+
- The package metadata uses the PEP 639 license form (`license = "MIT"`, `license-files`). The build needs `hatchling>=1.27`. The source archive (sdist) holds only the source, `tests/`, `docs/`, `examples/` and the project files. It no longer holds `bench/`, `.docs/` or the scripts.
|
|
46
|
+
- Breaking change: the variable `DOWNSHIFT_SERVER_API_KEY` is now `DOWNSHIFT_API_KEY`. The old name still works for one minor release. Downshift removes it in 1.1 at the earliest. If only the old name is set, downshift uses it and logs one warning. If both are set, `DOWNSHIFT_API_KEY` wins. To upgrade, rename the variable in your deployment.
|
|
47
|
+
- Breaking change: the keyword argument `k` is now `samples` in `check()`, `export()`, `intake()`, `build_verdict()` and `ServeOptions`. There is no alias. If you pass `k=...` or `ServeOptions(k=...)`, change it to `samples=...`. The CLI option `-k` and `--samples` does not change.
|
|
48
|
+
- Breaking change: the field `source_model` of `model.manifest.json` is now `source`. Its value does not change. If a script reads `source_model`, change it to `source`. Downshift itself does not read this field. A manifest without `format_version: 1` is not reused, so no old manifest is read by mistake.
|
|
49
|
+
- Breaking change: `--device` and `DOWNSHIFT_DEVICE` accept only `auto`, `cpu`, `cuda` and `cuda:N` (N is 0 or more). Any other value is now a usage error (exit code `4`), and the message lists the allowed values. Before, a wrong value worked by accident or failed later. To upgrade, use one of the allowed values.
|
|
50
|
+
- The export cache of 0.5.x exports again one time. The version of downshift is part of its key, and 1.0.0 adds the row check to the verdict.
|
|
51
|
+
- A bare `serve` or `app_for` on a model with independent rows now has the result cache on. To keep the old behavior, set `--result-cache-rows 0`.
|
|
52
|
+
- `/predict` with the cache on does the encoding on a prep thread and not on an inference thread.
|
|
53
|
+
- Breaking change: predict responses no longer have the `Server-Timing` header by default. The timings show how the server works, and a fast cache hit shows that another client sent the same row. To get the header back, pass `--server-timing` or set `DOWNSHIFT_SERVER_TIMING=1`. The access log still has the timings.
|
|
54
|
+
- `--axis-max` can also raise a default bound: the Hugging Face `batch` (4096), a Hugging Face `seq` without a position limit (4096), the PyG `num_nodes` and `num_edges` (65536), and the generic `dim0` and `--dynamic` axes (65536). Verification runs one sample at exactly `N`. The position limit of a Hugging Face model is still a limit. A value above it is a usage error, and the message gives the largest value. For a third-party adapter, `lower_axis_max` takes the hard limits as `limits`.
|
|
55
|
+
- The docs have a new structure. The pages of `docs/code-docs/` are now in `docs/` (`docs/cli.md`, `docs/http-api.md`, `docs/python-api.md`, `docs/serving.md`, `docs/adapters.md`, and the index `docs/README.md`). The README is shorter: it has the quick start, the gate, the model forms and the matrix. The reference material is in `docs/`. The GPU notes and the export cache are now in `docs/production.md`.
|
|
56
|
+
- The `400` for a graph batch that a model with a fixed-size output cannot split no longer says that graph-level batching is planned for 0.6.
|
|
57
|
+
- The code is simpler. The behavior of the CLI, the HTTP API, the environment variables and the names in `downshift.__all__` does not change. Some internal modules moved. If your code imports them, change the import:
|
|
58
|
+
- `downshift.core.prevalidated.intake` is now `downshift.core.verdict.intake`. `downshift.intake` does not change.
|
|
59
|
+
- `downshift.core.inputs.synthesize` is removed. `downshift.core.verdict.prepare_model` raises the same error.
|
|
60
|
+
- `downshift.serve.middleware.load_middleware` is now `downshift.serve.app.load_middleware`.
|
|
61
|
+
- `downshift.serve.engine.serving_state_from_artifact` and `serving_state_from_torch_artifact` are removed. Use `downshift.serve.engine.state_from_entry`.
|
|
62
|
+
- `downshift.core.verify.quiet_ort_logging` is removed. `new_session` silences the ONNX Runtime logger itself.
|
|
63
|
+
- `import downshift` does not read the environment. `export()` reads `DOWNSHIFT_EXPORT_CACHE_DIR` when you call it, not at import. `export_cache_dir=None` still means no disk tier.
|
|
64
|
+
|
|
65
|
+
### Removed
|
|
66
|
+
|
|
67
|
+
- The weekly workflow `compatibility-matrix.yml`. It opened a pull request each week with a new compatibility matrix. To make the matrix again, run `python scripts/gen_matrix.py`.
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
|
|
71
|
+
- `check --json` and `export --json` could print `Applied N of general pattern rewrite rules.` before the JSON, with `onnxscript` 0.5 (it prints this line on stdout during the export). The export now drops what `onnxscript` prints on stdout, so stdout holds only the JSON.
|
|
72
|
+
- With `--workers N`, an input named `file` or `allow_pickle` no longer breaks the hand-off of the example inputs to the workers. The file uses the `in.` name prefix, as the export cache does.
|
|
73
|
+
- `--device auto` now serves on the CPU if torch has a GPU but ONNX Runtime has no CUDA provider (or the provider does not start). The server logs one line. Before, the boot failed. An explicit `--device cuda` still fails with a message.
|
|
74
|
+
- `--device cuda:N` with N at or above the number of GPUs now gives a usage error that names the valid range. Before, it gave a raw error and exit code `5`.
|
|
75
|
+
- A `serve` process now frees the bytes of the ONNX graph after the boot. The session has its own copy.
|
|
76
|
+
- `downshift.export()` and `downshift export` now write nothing when the verdict is FAILED. Before, they wrote the `.onnx` file and the manifest if ONNX Runtime could not run the graph.
|
|
77
|
+
- `check()` and `app_for()` now work with a model on a CUDA device. Before, the verdict was FAILED with the message that ONNX Runtime cannot run the graph.
|
|
78
|
+
- The export cache now removes the `.tmp-*` and `.old-*` directories of a killed writer when they are more than 1 hour old.
|
|
79
|
+
- The export cache now keeps an example input that is named `file` or `allow_pickle`. Before, saving it raised an error.
|
|
80
|
+
- The opset in the verdict now comes from the default domain of the graph. Before, it came from the first domain.
|
|
81
|
+
- A NaN or inf in an output no longer gives "max abs err 0.00e+00" with no worst element. The error numbers use the finite values only. The report counts the non-finite mismatches and names the first as the worst element. The pass or fail rule did not change.
|
|
82
|
+
- A usage error of a command (an unknown flag, a missing argument, a bad value such as `--workers 0`) now exits with `4`. Before, it exited with `2`, which is the DEGRADED code.
|
|
83
|
+
- A bad `DOWNSHIFT_*` value (for example `DOWNSHIFT_PORT=abc`) now gives a one-line error that names the variable, and exit code `4`. Before, it gave a traceback, also for `--help`.
|
|
84
|
+
- `--metrics` with `--workers N` (N above 1) is now a usage error (exit code `4`). A scrape reaches one worker only. Run one worker for each container and scale with replicas.
|
|
85
|
+
- On ONNX Runtime, `--device cuda:N` now serves on GPU `N`. Before, it served on the CPU with no error.
|
|
86
|
+
- With the result cache on, a request no longer gets the error of another request. Before, if the first request for a row failed (for example, a `400` for another row of its batch), each request that waited for that row got the same error. Now each waiting request computes the row itself.
|
|
87
|
+
- With the result cache on, a request that ends late no longer frees a row that a newer request owns. A request that ends with an output without a row axis no longer makes the other requests wait for its rows. A request that is past `--request-timeout` no longer claims rows.
|
|
88
|
+
- `/predict` with `"text": []` now gives `400` (`invalid_input`).
|
|
89
|
+
- The token count in `usage` of `/v1/embeddings` now comes from the tokenizer. Before, a model with no `attention_mask` input gave the padded length, and the count changed with the longest row of the batch.
|
|
90
|
+
- An `HTTPException` that your own `--middleware` raises now gives its own status and the code `http_error`. Before, it gave `500` (`internal_error`).
|
|
91
|
+
- A `TimeoutError` inside a backend or your own code is no longer reported as `request_timeout` (`503`). Only the `--request-timeout` limit gives that code.
|
|
92
|
+
- The server now keeps a request ID from a client only if it has 1 to 128 characters from `A-Z a-z 0-9 . _ : -`. If not, it makes a new ID.
|
|
93
|
+
- If `DOWNSHIFT_API_KEY` is set to an empty value, it now turns the key off, even if the old name `DOWNSHIFT_SERVER_API_KEY` is set. Before, the old name was used.
|
|
94
|
+
- `GET /v1` (with no slash) now gives the OpenAI error shape.
|
|
95
|
+
- `/v1/embeddings` with `dimensions` no longer overflows when the model gives `float16` vectors.
|
|
96
|
+
- `--request-timeout` now stops the request at the set time. Before, a running step could pass the limit, and the `503` came late.
|
|
97
|
+
- `--request-timeout` is now the time limit for the whole request, from its admission: the body read, the queue, the inference and the encoding. At the limit, the client gets a `503` (`request_timeout`) and the slot is free. The thread of an inference that already runs is not stopped. The docs and the `--help` said that the limit was a queue wait only. They now agree with the code.
|
|
98
|
+
- The `--help` of `--workers` said that each worker exports the model. The parent exports and verifies one time, and each worker loads that result.
|
|
99
|
+
- The docs agree with the code again. `docs/cli.md` lists `--axis-max`, `--export-cache-dir`, `--tokenizer-from`, `DOWNSHIFT_AXIS_MAX` and `DOWNSHIFT_EXPORT_CACHE_DIR`, and its steps to add a `serve` option are correct. `docs/serving.md` has the current signatures, `ServingState` fields and backend errors. `docs/python-api.md` says that `check()` never reads the export memo. `docs/production.md` says that each `--workers` worker gives `503` on `/ready` while it loads.
|
|
100
|
+
|
|
101
|
+
## 0.5.1 - 2026-10-11
|
|
102
|
+
|
|
103
|
+
### Added
|
|
104
|
+
|
|
105
|
+
- HTTPS. `serve --ssl-certfile PATH --ssl-keyfile PATH` (or `DOWNSHIFT_SSL_CERTFILE` and `DOWNSHIFT_SSL_KEYFILE`) serves HTTPS with your certificate. For an encrypted key, set `DOWNSHIFT_SSL_KEYFILE_PASSWORD`. Downshift loads the files before the model. A bad file is a usage error (exit code `4`) with a next step. Downshift uses the TLS settings of `ssl.create_default_context`: TLS 1.2 or later and the cipher list of the standard library. The default of uvicorn also enables NULL and anonymous ciphers. `--workers N` works with HTTPS. The banner, the `will listen on` line and `example_curl` in `/schema` show `https://`. The `serving with:` block has a `tls` row. Refer to "HTTPS" in `docs/production.md`.
|
|
106
|
+
- `GET /`. It gives the service name, the version, `ready`, the model, all routes, and the next step (`GET /schema`). A client that knows only the base URL can find the input format. If the API key is active, this route needs the key.
|
|
107
|
+
- `llms.txt` and `AGENTS.md` at the root of the repo. `llms.txt` tells an LLM agent how to call a server and how to host a model. `AGENTS.md` tells a coding agent how to set up, test and change this repo.
|
|
108
|
+
- `--help` of `check`, `export` and `serve` shows the exit codes and an example.
|
|
109
|
+
|
|
110
|
+
### Changed
|
|
111
|
+
|
|
112
|
+
- More usage errors give a next step. These errors changed:
|
|
113
|
+
- A missing adapter file.
|
|
114
|
+
- A missing or read-only `--export-cache-dir`.
|
|
115
|
+
- `export` of a `.onnx` file.
|
|
116
|
+
- `--backend torch` with no PyTorch model.
|
|
117
|
+
- A repo with `auto_map`.
|
|
118
|
+
- A pooling recipe that downshift cannot apply.
|
|
119
|
+
|
|
120
|
+
A client or script that matches the old text must change.
|
|
121
|
+
- The `400` for text that is too long had a doubled word. The message now also gives the next step: send shorter text, or split the text into more rows.
|
|
122
|
+
|
|
6
123
|
## 0.5.0 - 2026-10-10
|
|
7
124
|
|
|
8
125
|
### Added
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: downshift-server
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Serve PyTorch models over HTTP through ONNX Runtime. Downshift verifies each export against PyTorch before it serves, and it falls back to eager PyTorch.
|
|
5
|
+
Project-URL: Homepage, https://github.com/uNRealCoder/downshift-server
|
|
6
|
+
Project-URL: Repository, https://github.com/uNRealCoder/downshift-server
|
|
7
|
+
Project-URL: Documentation, https://downshift-server.readthedocs.io
|
|
8
|
+
Project-URL: Changelog, https://github.com/uNRealCoder/downshift-server/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Issues, https://github.com/uNRealCoder/downshift-server/issues
|
|
10
|
+
Author-email: Nikhil Ranjan <nrnikhilranjan1997@gmail.com>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: export,model-serving,onnx,pytorch
|
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: <3.15,>=3.12
|
|
22
|
+
Requires-Dist: fastapi>=0.115
|
|
23
|
+
Requires-Dist: numpy>=2.0
|
|
24
|
+
Requires-Dist: onnx>=1.23
|
|
25
|
+
Requires-Dist: onnxruntime>=1.20
|
|
26
|
+
Requires-Dist: onnxscript>=0.5
|
|
27
|
+
Requires-Dist: orjson>=3.10.7
|
|
28
|
+
Requires-Dist: pydantic>=2.5
|
|
29
|
+
Requires-Dist: torch>=2.8
|
|
30
|
+
Requires-Dist: typer>=0.19
|
|
31
|
+
Requires-Dist: uvicorn[standard]>=0.30
|
|
32
|
+
Provides-Extra: all
|
|
33
|
+
Requires-Dist: pybase64>=1.4; extra == 'all'
|
|
34
|
+
Requires-Dist: torch-geometric>=2.7; extra == 'all'
|
|
35
|
+
Requires-Dist: transformers>=5.17; extra == 'all'
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: httpx>=0.24; extra == 'dev'
|
|
38
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: openai>=1.40; extra == 'dev'
|
|
40
|
+
Requires-Dist: prometheus-client>=0.20; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
43
|
+
Requires-Dist: ruff==0.17.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: safetensors>=0.4; extra == 'dev'
|
|
45
|
+
Provides-Extra: fast
|
|
46
|
+
Requires-Dist: pybase64>=1.4; extra == 'fast'
|
|
47
|
+
Provides-Extra: gnn
|
|
48
|
+
Requires-Dist: torch-geometric>=2.7; extra == 'gnn'
|
|
49
|
+
Provides-Extra: hf
|
|
50
|
+
Requires-Dist: transformers>=5.17; extra == 'hf'
|
|
51
|
+
Description-Content-Type: text/markdown
|
|
52
|
+
|
|
53
|
+
# downshift
|
|
54
|
+
|
|
55
|
+
Downshift is verified export for a model you already have: CPU-first, one process for each model, and eager PyTorch when the export is not correct.
|
|
56
|
+
|
|
57
|
+
Serve a downloaded model over HTTP with one command. Before the first request, downshift exports the model to ONNX and compares the ONNX graph with PyTorch on inputs that the exporter did not see. If the graph gives wrong numbers, downshift serves eager PyTorch instead.
|
|
58
|
+
|
|
59
|
+
Everything that downshift serves is already on the machine: a PyTorch checkpoint, an ONNX file, a downloaded Hugging Face repo directory, or an `nn.Module` that Python can import. Downshift fetches nothing.
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
$ downshift serve examples.scatter_include_self_false:make_model
|
|
63
|
+
|
|
64
|
+
2026-10-20 16:20:33 WARNING downshift.serve: DOWNSHIFT_API_KEY is not set, so the endpoints (including /metadata) are unauthenticated. Set it to require a fixed API key, or add your own authentication middleware.
|
|
65
|
+
2026-10-20 16:20:33 INFO downshift.report: loading examples.scatter_include_self_false:make_model
|
|
66
|
+
2026-10-20 16:20:33 INFO downshift.report: will listen on http://127.0.0.1:8000 (not ready yet)
|
|
67
|
+
2026-10-20 16:20:36 INFO downshift.report: verify: sample 1/8, x [6, 8], segment_ids [6]
|
|
68
|
+
...
|
|
69
|
+
2026-10-20 16:20:36 INFO downshift.report: verify: sample 8/8, x [7, 8], segment_ids [7]
|
|
70
|
+
2026-10-20 16:20:36 INFO downshift.report: downshift v1.0.0
|
|
71
|
+
Model examples.scatter_include_self_false:make_model
|
|
72
|
+
Family generic
|
|
73
|
+
Verdict DEGRADED (strict=False, opset 20)
|
|
74
|
+
Numerics max abs err 1.62e+00 over 8 samples 6/8 failed
|
|
75
|
+
! numerics diverge on 6/8 samples (max abs err 1.62e+00)
|
|
76
|
+
Override --force-onnx to serve the ONNX graph anyway
|
|
77
|
+
Tolerance atol 1e-04, rtol 1e-03 (float32)
|
|
78
|
+
Worst output_0[3, 0]: torch 0.2167, onnxruntime 1.8388 (sample 2, x (7,8), segment_ids (7))
|
|
79
|
+
Samples x: (6,8) (12,8) (7,8) (7,8) (1,8) (12,8) (1,8) (7,8)
|
|
80
|
+
segment_ids: (6) (12) (7) (7) (1) (12) (1) (7)
|
|
81
|
+
Rows not checked (the numerics check failed)
|
|
82
|
+
Cache off (the numerics check failed)
|
|
83
|
+
Warmup 3 inferences, 0.09 ms each
|
|
84
|
+
Boot 2.9 s: load 0.0, export 2.8, verify 0.0, session 0.0, warmup 0.0
|
|
85
|
+
Backend torch (eager) | cpu <- auto-selected
|
|
86
|
+
Verified on CPUExecutionProvider
|
|
87
|
+
Dynamic dims `dim0` (x[0]) sampled 1-12, serves 1-65536 ! unverified above 12
|
|
88
|
+
`dim0` (segment_ids[0]) sampled 1-12, serves 1-65536 ! unverified above 12
|
|
89
|
+
Encoding json (clients override with output_encoding)
|
|
90
|
+
Capacity 4 inferences at a time, 4 prep threads, 64 queued, 30 s timeout (--max-concurrency, --prep-threads, --max-queue, --request-timeout)
|
|
91
|
+
Execution threadpool (--execution)
|
|
92
|
+
Endpoint http://127.0.0.1:8000 (GET /schema for the input format)
|
|
93
|
+
2026-10-20 16:20:36 INFO downshift.report: ready in 2.9 s
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This graph exported without an error, but it gives wrong numbers on 6 of 8 inputs. Downshift found the fault before the first request and serves PyTorch instead. The model is [`examples/scatter_include_self_false.py`](examples/scatter_include_self_false.py). To run the command, use a clone of this repo.
|
|
97
|
+
|
|
98
|
+
## Install
|
|
99
|
+
|
|
100
|
+
If the machine has no GPU, install the CPU build of torch first. The default wheel is much larger.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install torch --index-url https://download.pytorch.org/whl/cpu
|
|
104
|
+
pip install downshift-server # core: any nn.Module, any .onnx
|
|
105
|
+
pip install "downshift-server[hf]" # + Hugging Face repos, text input
|
|
106
|
+
pip install "downshift-server[gnn]" # + PyTorch Geometric adapter
|
|
107
|
+
pip install "downshift-server[fast]" # + pybase64, about 12x faster base64 tensors
|
|
108
|
+
pip install "downshift-server[all]" # hf, gnn and fast
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
For a GPU, install a CUDA build of torch, and install `onnxruntime-gpu` in place of `onnxruntime`. Refer to [`docs/production.md`](docs/production.md#gpu).
|
|
112
|
+
|
|
113
|
+
Downshift needs Python 3.12 to 3.14. If the `downshift` command is not on `PATH`, use `python -m downshift`.
|
|
114
|
+
|
|
115
|
+
## Quick start
|
|
116
|
+
|
|
117
|
+
To try downshift with no clone, write a file `model.py`:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import torch
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def make_model():
|
|
124
|
+
return torch.nn.Linear(4, 2).eval()
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def make_inputs():
|
|
128
|
+
return (torch.randn(1, 4),)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Check the model, then serve it:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
downshift check model:make_model
|
|
135
|
+
downshift serve model:make_model --port 8000
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The check prints the verdict. This is the output for `model.py`:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
Export CLEAN (strict=False, opset 20)
|
|
142
|
+
Numerics max abs err 1.19e-07 over 8 samples OK
|
|
143
|
+
Rows independent
|
|
144
|
+
Backend onnxruntime
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
When `GET /ready` gives `200`, send a request in a second terminal:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
curl -s localhost:8000/predict -H 'content-type: application/json' \
|
|
151
|
+
-d '{"inputs": {"input": [[1.0, 2.0, 3.0, 4.0]]}}'
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{"outputs":{"output_0":[[-2.7712083,0.8470939]]},"shapes":{"output_0":[1,2]},"dtypes":{"output_0":"float32"}}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The numbers depend on the random weights of the layer. The steps below are for your own model.
|
|
159
|
+
|
|
160
|
+
1. Start the server. The port opens at once. The gate runs in the background.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
downshift serve my_pkg.models:build --port 8000
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
2. Wait until `GET /ready` gives `200`. Until then, it gives `503` with the current phase.
|
|
167
|
+
3. Ask the server what to send. `GET /schema` reads the input names, dtypes, shapes and bounds from the graph that runs. It also gives an `example_request` that you can send back unchanged.
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
curl -s localhost:8000/schema | python -m json.tool
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
4. Send a request:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
curl -s localhost:8000/predict -H 'content-type: application/json' \
|
|
177
|
+
-d '{"inputs": {"x": [[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]]}}'
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{"outputs": {"output_0": [[0.199, -0.206, 0.561, 0.405]]},
|
|
182
|
+
"shapes": {"output_0": [1, 4]},
|
|
183
|
+
"dtypes": {"output_0": "float32"}}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Integer lists become `int64`, and all other lists become `float32`. For large tensors, send base64 or a safetensors body. A Hugging Face repo with a tokenizer also takes `{"text": [...]}`. A graph model takes `x` and `edge_index` on `POST /predict/graph`. Refer to [`docs/http-api.md`](docs/http-api.md).
|
|
187
|
+
|
|
188
|
+
A text embedding model also has the OpenAI embeddings route. Change only `base_url` and `api_key` in the `openai` package. Refer to [`docs/openai.md`](docs/openai.md).
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
from openai import OpenAI
|
|
192
|
+
|
|
193
|
+
client = OpenAI(base_url="http://localhost:8000/v1", api_key="not-used")
|
|
194
|
+
vectors = client.embeddings.create(model="bge-small", input=["hello"]).data[0].embedding
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
| Route | Purpose |
|
|
198
|
+
|---|---|
|
|
199
|
+
| `GET /` | The version, the model, `ready`, and all routes. Start here if you know only the base URL. |
|
|
200
|
+
| `GET /health` | Liveness. `200` while the process is up, also during the load. |
|
|
201
|
+
| `GET /ready` | Readiness. `503` until the model is loaded, verified and warmed up. |
|
|
202
|
+
| `GET /schema` | What to POST, with an example body. |
|
|
203
|
+
| `GET /metadata` | The verdict, the backend, the limits and the boot timings. |
|
|
204
|
+
| `POST /predict` | Named tensors, or `text`. JSON or safetensors. |
|
|
205
|
+
| `POST /predict/graph` | One graph, or a batch of graphs. |
|
|
206
|
+
| `POST /v1/embeddings` | The OpenAI embeddings route, for a text embedding model. Also `GET /v1/models`. |
|
|
207
|
+
|
|
208
|
+
To mount the same app in your own FastAPI service, use `downshift.serve.app_for(model, example_inputs)`. Refer to [`docs/python-api.md`](docs/python-api.md#app_for). To deploy, read [`docs/production.md`](docs/production.md).
|
|
209
|
+
|
|
210
|
+
## The gate
|
|
211
|
+
|
|
212
|
+
A successful `torch.onnx.export` does not prove that the graph computes the same function as the model. Before downshift serves anything, it exports the model in memory. It then runs 8 samples by default through PyTorch and through ONNX Runtime, and it varies the dynamic axes, so some samples have shapes that the exporter did not see. The result is one of four verdicts, and the verdict selects the backend:
|
|
213
|
+
|
|
214
|
+
| Verdict | Meaning | Served by |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| CLEAN | The model exports, matches PyTorch on every sample, and works on shapes that the trace did not include. | ONNX Runtime |
|
|
217
|
+
| DEGRADED | The model exports, but the numbers differ by more than the tolerance on at least one sample. | eager PyTorch (`--force-onnx` overrides) |
|
|
218
|
+
| FAILED | The model does not export, or ONNX Runtime cannot load or run the graph. | eager PyTorch |
|
|
219
|
+
| UNVERIFIED | A `.onnx` file with no `--reference` model, or `--no-verify`. | ONNX Runtime, labelled as never checked |
|
|
220
|
+
|
|
221
|
+
The gate also runs alone:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
downshift check my_pkg.models:build --json > verdict.json # exit code = verdict: 0 CLEAN, 1 FAILED, 2 DEGRADED, 3 UNVERIFIED
|
|
225
|
+
downshift export my_pkg.models:build -o artifacts/ # writes the .onnx file and a manifest
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`check` can gate CI. Exit code `4` is a usage error, and `5` is a crash. [`docs/cli.md`](docs/cli.md) describes each flag, the tolerances and the report.
|
|
229
|
+
|
|
230
|
+
### Result cache
|
|
231
|
+
|
|
232
|
+
The result cache is on when the row check finds the rows independent. The row check uses two rows, so it cannot prove that a small effect is absent. On a server with more than one tenant, a hit is faster than a miss, and a client can see the difference. To turn the cache off, set `--result-cache-rows 0`. Refer to [Result cache](docs/production.md#result-cache).
|
|
233
|
+
|
|
234
|
+
## Accepted model forms
|
|
235
|
+
|
|
236
|
+
| Argument | Meaning |
|
|
237
|
+
|---|---|
|
|
238
|
+
| `model.onnx` | A downloaded or already exported ONNX file. Served as it is. UNVERIFIED unless you give `--reference model`. |
|
|
239
|
+
| `weights.pt` | A downloaded PyTorch checkpoint (state dict). Needs `--model-class pkg.module:Class`. `.pth`, `.bin` and `.ckpt` also work. Downshift loads it with `weights_only=True`. `--unsafe-load` allows a pickled module from a file that you trust. |
|
|
240
|
+
| `path/to/repo/dir/` | A downloaded Hugging Face repo: a directory with a `config.json`. Needs the `[hf]` extra. |
|
|
241
|
+
| `pkg.module:attr` | An `nn.Module`, or a function that returns one. If the module has a `make_inputs` function, downshift uses it for the example inputs. Otherwise, give `--inputs pkg.module:fn`. |
|
|
242
|
+
|
|
243
|
+
Downshift serves a Hugging Face repo the way its own files say:
|
|
244
|
+
|
|
245
|
+
- A classifier (`...ForSequenceClassification`) loads with its head and also returns class probabilities.
|
|
246
|
+
- A sentence-transformers repo (`modules.json`, `1_Pooling/`) is pooled and normalised inside the exported graph, so the verification covers the embedding.
|
|
247
|
+
- With tokenizer files, `/predict` takes `{"text": ...}`. A row that is longer than the model reads gets a `400`. Downshift never cuts a row.
|
|
248
|
+
|
|
249
|
+
`downshift serve model.onnx --tokenizer-from repo/` serves a graph that someone else exported (for example with `optimum` or Olive) and keeps text input, with the tokenizer and recipe of the repo.
|
|
250
|
+
|
|
251
|
+
Downshift never contacts the Hugging Face hub and rejects a hub id. Download the repo first:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
huggingface-cli download bert-base-uncased --local-dir ./bert-base-uncased
|
|
255
|
+
downshift serve ./bert-base-uncased
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Compatibility matrix
|
|
259
|
+
|
|
260
|
+
`scripts/gen_matrix.py` generates this table from the fixtures in `tests/models/`. Each fixture isolates one export hazard. To make the table again, run `python scripts/gen_matrix.py`. The full file, with versions, is [docs/compatibility.md](docs/compatibility.md). The same page lists [Tested real models](docs/compatibility.md#tested-real-models): public Hugging Face, torchvision and PyG models that `scripts/check_real_models.py` checks.
|
|
261
|
+
|
|
262
|
+
<!-- matrix:start -->
|
|
263
|
+
| Model | Hazard | Family | Export | Capture | Numerics | Shape-general | Backend |
|
|
264
|
+
|---|---|---|---|---|---|---|---|
|
|
265
|
+
| `bf16_weights` | bfloat16 weights: ONNX Runtime CPU has no bf16 Gemm kernel | generic | FAILED | strict=False | — | — | torch |
|
|
266
|
+
| `broken_factory` | Not an export hazard fixture: raises as soon as it is instantiated | — | skipped (RuntimeError) | — | — | — | — |
|
|
267
|
+
| `clean_mlp` | Control fixture: no export hazards | generic | CLEAN | strict=False | 1.2e-07 | ✓ | onnxruntime |
|
|
268
|
+
| `custom_autograd` | custom autograd.Function with no symbolic override | generic | CLEAN | strict=False | 2.4e-07 | ✓ | onnxruntime |
|
|
269
|
+
| `data_dependent_branch` | data-dependent control flow | generic | FAILED | — | — | — | torch |
|
|
270
|
+
| `dict_input` | dataclass container input | generic | CLEAN | strict=False | 1.2e-07 | ✓ | onnxruntime |
|
|
271
|
+
| `dropout_model` | stochastic layer | generic | CLEAN | strict=False | 2.4e-07 | ✓ | onnxruntime |
|
|
272
|
+
| `dynamic_batch_cnn` | batch-dim generalization | generic | CLEAN | strict=False | 6.0e-08 | ✓ | onnxruntime |
|
|
273
|
+
| `gnn_gat` | GNN fixture: 3-layer GAT node classifier | pyg | CLEAN | strict=False | 1.2e-07 | ✓ | onnxruntime |
|
|
274
|
+
| `gnn_gcn` | GNN fixture: 2-layer GCN node classifier | pyg | CLEAN | strict=False | 1.2e-07 | ✓ | onnxruntime |
|
|
275
|
+
| `gnn_sage` | GNN fixture: 2-layer GraphSAGE node classifier | pyg | CLEAN | strict=False | 2.1e-07 | ✓ | onnxruntime |
|
|
276
|
+
| `scatter_include_self_false` | scatter_reduce(include_self=False) has no faithful ONNX translation | generic | DEGRADED | strict=False | 9.5e-01 | — | torch |
|
|
277
|
+
| `tied_weights` | tied embedding/output weight (GPT-2/OPT-style) | generic | CLEAN | strict=False | 3.8e-06 | ✓ | onnxruntime |
|
|
278
|
+
| `tiny_bert` | HF fixture: a BERT encoder with two layers and random initialization | hf | CLEAN | strict=False | 7.2e-07 | ✓ | onnxruntime |
|
|
279
|
+
<!-- matrix:end -->
|
|
280
|
+
|
|
281
|
+
Read these rows carefully:
|
|
282
|
+
|
|
283
|
+
- `scatter_include_self_false` exports without an error and returns wrong numbers. Only the numerics check stops this graph from reaching production.
|
|
284
|
+
- `bf16_weights` exports without an error, but ONNX Runtime cannot run it, because bfloat16 has no CPU Gemm kernel. It is a FAILED verdict and serves on torch.
|
|
285
|
+
- `custom_autograd` is CLEAN. `torch.export` traces through a `Function.forward` that has ordinary operations.
|
|
286
|
+
|
|
287
|
+
## Scope and non-goals
|
|
288
|
+
|
|
289
|
+
Downshift serves models that give their answer in one forward pass: tensors in, tensors out. The gate compares one pass between the ONNX graph and PyTorch. GNNs, encoders, classifiers, embedders and your own `nn.Module` classes fit. A model that needs a loop around it does not fit.
|
|
290
|
+
|
|
291
|
+
- **No text generation.** There is no KV cache or sampling loop. There are no chat or completions routes. (`/v1/embeddings` exists.) Use vLLM, TGI or llama.cpp. Downshift refuses a decoder-only repo (`...ForCausalLM`), unless it has an embedding recipe, as Qwen3-Embedding has.
|
|
292
|
+
- **No remote code.** Downshift never sets `trust_remote_code`. A repo with an `auto_map` does not load. Export it to ONNX yourself and serve it with `--tokenizer-from`.
|
|
293
|
+
- **No multimodal Hugging Face models.** Text in, one tensor out.
|
|
294
|
+
- **No quantization or graph optimization.** Use Olive or `onnxruntime.quantization`, then serve the result with `downshift serve model.onnx --reference model.pt`, so downshift verifies it against the original weights. `--fp16` changes the fp32 graph to fp16 weights, with fp32 inputs and outputs.
|
|
295
|
+
- **No dynamic request batching.** One request makes one inference. `/predict/graph` joins a batch of graphs only when the outputs are for each node or each edge.
|
|
296
|
+
- **No container image in 1.0.** Container images come in 1.1. Use pip and version pins until then.
|
|
297
|
+
- **No DGL adapter.** PyG is the supported GNN family.
|
|
298
|
+
|
|
299
|
+
To add a model family, write an adapter. Refer to [`docs/adapters.md`](docs/adapters.md).
|
|
300
|
+
|
|
301
|
+
## When not to use downshift
|
|
302
|
+
|
|
303
|
+
| Your need | Use |
|
|
304
|
+
|---|---|
|
|
305
|
+
| High-QPS embeddings at large batch sizes | TEI or Infinity (dynamic batching) |
|
|
306
|
+
| Many models on a GPU fleet | Triton Inference Server |
|
|
307
|
+
| Text generation | vLLM |
|
|
308
|
+
|
|
309
|
+
## Documentation
|
|
310
|
+
|
|
311
|
+
- [`docs/cli.md`](docs/cli.md): every command, flag, environment variable and exit code.
|
|
312
|
+
- [`docs/http-api.md`](docs/http-api.md): every route, body, status code and wire format.
|
|
313
|
+
- [`docs/openai.md`](docs/openai.md): the `/v1/embeddings` route for OpenAI clients.
|
|
314
|
+
- [`docs/production.md`](docs/production.md): authentication, HTTPS, probes, workers, caches, sizing, GPUs and Kubernetes.
|
|
315
|
+
- [`docs/python-api.md`](docs/python-api.md): `check`, `export`, `intake`, `app_for` and the verdict.
|
|
316
|
+
- [`docs/serving.md`](docs/serving.md) and [`docs/adapters.md`](docs/adapters.md): the internals, for contributors.
|
|
317
|
+
- [`llms.txt`](llms.txt) for an LLM agent that calls or hosts a server. [`AGENTS.md`](AGENTS.md) for a coding agent that changes this repo.
|
|
318
|
+
- [`CHANGELOG.md`](CHANGELOG.md).
|
|
319
|
+
|
|
320
|
+
## Development
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
pip install -e ".[dev,all]"
|
|
324
|
+
ruff check .
|
|
325
|
+
ruff format --check .
|
|
326
|
+
mypy src
|
|
327
|
+
pytest
|
|
328
|
+
python scripts/gen_matrix.py # makes docs/compatibility.md and the table above again
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
CI requires 95% line coverage (`--cov-fail-under=95`). The HTTPS tests make a temporary certificate with `openssl`. If `openssl` is not on `PATH`, these tests skip.
|
|
332
|
+
|
|
333
|
+
## License
|
|
334
|
+
|
|
335
|
+
MIT.
|