src/hark/ has exactly two third-party runtime imports:
fastapi in app.py:15
httpx in whisper.py:8
Those two, plus uvicorn, pull 24 packages and 26 MB into the venv (uv tree: pydantic, pydantic-core, starlette, anyio, httpcore, certifi, h11, click, idna, typing-extensions, and the rest). Everything else the service imports is stdlib: wave, array, re, secrets, asyncio, logging, tomllib.
For one user sending one request at a time to loopback, http.server.ThreadingHTTPServer plus roughly 20 lines of hand-rolled multipart for the whisper-server call would cover it. Async buys nothing at this concurrency.
The catch
This does not remove the need for uv. System python3 on macOS is 3.9.6 with no tomllib, and config.py:16 needs 3.11 or newer. Depending on Apple's deprecated /usr/bin/python3 would be a worse dependency than a managed interpreter, not a better one.
So the win is 24 packages to 0, not "no Python toolchain". Lower priority than #2 and #3 for that reason.
Cost
- hand-rolled multipart encoding, which is exactly the kind of thing a library gets right and a hand roll gets subtly wrong
- losing
fastapi.testclient, so tests/test_app.py needs reworking against a real socket or a hand-built request object
- losing automatic 422 handling and the
{"detail": ...} body shape that client/init.lua's extractDetail parses
That last one is a compatibility constraint, not just a nicety. Whatever replaces FastAPI has to keep emitting {"detail": "..."} or the client's error alerts go blank.
src/hark/has exactly two third-party runtime imports:fastapiinapp.py:15httpxinwhisper.py:8Those two, plus
uvicorn, pull 24 packages and 26 MB into the venv (uv tree: pydantic, pydantic-core, starlette, anyio, httpcore, certifi, h11, click, idna, typing-extensions, and the rest). Everything else the service imports is stdlib:wave,array,re,secrets,asyncio,logging,tomllib.For one user sending one request at a time to loopback,
http.server.ThreadingHTTPServerplus roughly 20 lines of hand-rolled multipart for the whisper-server call would cover it. Async buys nothing at this concurrency.The catch
This does not remove the need for
uv. Systempython3on macOS is 3.9.6 with notomllib, andconfig.py:16needs 3.11 or newer. Depending on Apple's deprecated/usr/bin/python3would be a worse dependency than a managed interpreter, not a better one.So the win is 24 packages to 0, not "no Python toolchain". Lower priority than #2 and #3 for that reason.
Cost
fastapi.testclient, sotests/test_app.pyneeds reworking against a real socket or a hand-built request object{"detail": ...}body shape thatclient/init.lua'sextractDetailparsesThat last one is a compatibility constraint, not just a nicety. Whatever replaces FastAPI has to keep emitting
{"detail": "..."}or the client's error alerts go blank.