changh95's picture
tt-model push diffusion-planner-p150 (container)
4d9b003 verified
Raw History Blame Contribute Delete
1 kB
# SPDX-License-Identifier: Apache-2.0
"""C08 HTTP serving shared by every bundle.
- ``server.app``: :func:`create_app` builds the FastAPI (ASGI) app of a bundle from a :class:`ServerSpec`
(routes ``/``, ``/health``, ``/v1/health``, ``/info``, ``/v1/models``, ``/predict``; lifespan = weights -> device ->
graph -> trace capture; errors 400 / 422 / 503 / 500). Imports fastapi / pydantic.
- ``server.client``: standard-library-only request builder, HTTP helpers and smoke checks (``/info`` must report
the pinned dispatch and grid).
- ``server.smoke``: standard-library-only agreement of a served body with a stored CPU-reference body (every output
family, numpy-free npz / png decoding) and the serve-profile pins of a staged tt-model manifest.
Neither imports anything from ttaw, so a bundle's ``smoke_test.py`` can load them by path and run under any
Python 3.9+ outside the container. This ``__init__`` imports nothing, so ``import <pkg>.ttaw.server.client`` never
pulls in fastapi.
"""