Docker deployment guide
Docker prompt compression microservice
Running SuperCompress as a Docker microservice gives you a standalone compression endpoint that any application in your infrastructure can call — regardless of language or framework.
Dockerfile
FROM python:3.11-slim
WORKDIR /app
RUN pip install supercompress fastapi uvicorn
COPY server.py .
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8080"]
FastAPI server
from fastapi import FastAPI
from supercompress import Compressor
from pydantic import BaseModel
app = FastAPI()
comp = Compressor()
class CompressRequest(BaseModel):
context: str
query: str
@app.post("/compress")
async def compress(req: CompressRequest):
result = comp.compress(req.context, req.query)
return {"compressed_text": result.compressed_text,
"original_tokens": result.original_tokens,
"kept_tokens": result.kept_tokens}
Frequently asked questions
How small is the Docker image?
~150MB with python:3.11-slim. Can be reduced further with distroless images.
Can I scale it horizontally?
Yes. The microservice is stateless. Deploy behind a load balancer for horizontal scaling.
Build with less context
Put compression in front of your next LLM call.
Use the hosted API or run SuperCompress locally. Keep the evidence, drop the token waste, and measure the savings before it reaches your model.