A blazingly fast PGO/BOLT-optimised axum API for compiling La/TeX offline with Tectonic, hosted on Hugging Face Spaces.
Important
\input is not supported as it requires access to your file system.
GET /v2/pdf (compile TeX/LaTeX source)
name type data type description source required stringLa/TeX source code
http code content-type reason 200application/pdfcompiled PDF document 400text/plainbad request 500text/plaininternal server error
curl https://winstxnhdw-tectonic-api.hf.space/api/v2/pdf?source=<TEX_SOURCE_CODE>
You can spin the server up locally by first building the Docker image.
docker build -f Dockerfile.build -t tectonic-api .Finally, you can run the Docker container with the following environment variables.
docker run --init --rm \
-e SERVER_PORT=7860 \
-e MAX_CACHE_MEMORY=12884901888 \
-e CACHE_EXPIRY=3600 \
-p 7860:7860 \
tectonic-api