Add Docker container capability - #295
Conversation
|
Two install traps worth guarding against in this Dockerfile, both hit on a stock
With those two, the pytorch devel image works as a second base: driver ≥ 580 / |
|
None of these issues exist on this Dockerfile as I'm not using the base image you mention. I assume if you wanted to deviate from the Dockerfile, then you'll likely hit on problems that are outside of the scope of this PR. 1: This is not a problem in this base image. Regarding the |
Summary of Changes
Adds complete Docker and Docker Compose support for deploying FreeToken with GPU acceleration and native Hugging Face model integration.
What's Changed
Dockerfile:nvidia/cuda:13.3.1-devel-ubuntu26.04as the base image to providenvccand CUDA headers needed for FreeToken's C++ extensions and JIT kernel compilation.CUDA_HOME,CPATH,LIBRARY_PATH,LD_LIBRARY_PATH) to ensure compilation headers (e.g.cuda_runtime_api.h) are resolved without errors.uvwith a pinned Python 3.11 virtual environment to adhere to PEP 668 and avoid ABI mismatches with PyTorch extension builds.freetoken[accel]with pre-installed build toolchain (torch,setuptools,wheel,ninja).ft serveas the container entrypoint exposing port1919.docker-compose.yml:ipc: hostto allocate sufficient shared memory for tensor parallelism and KV cache operations.~/.cache/huggingfaceto persist downloaded model weights across container restarts.MODEL_NAMEenvironment variable.Configuration & Documentation:
DOCKER_README.mdcontaining end-to-end instructions for building, configuring, running via Compose or CLI, and verifying inference via OpenAI-compatible endpoints.Verification
ft serveand pulls model weights directly from Hugging Face into the mounted cache volume.http://127.0.0.1:1919/v1/chat/completions.