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.
Try it yourself
Paste your long prompt into the playground, ask a question, and see what SuperCompress keeps and removes. Free, no signup needed.