This guide walks you through deploying the RAG PDF Highlighter FastAPI application with Uvicorn and calling it over HTTP. Once running, any client that can make HTTP requests — curl, Python, JavaScript, or any other language — can submit a PDF URL and a list of text chunks and receive an annotated PDF in return.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MuhammadSalmanAhmad/rag-pdf-highlighter/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Python >= 3.10
pipavailable in your environment
Steps
Start the server
Launch the FastAPI application with Uvicorn, binding to all interfaces on port 8000:
Verify the health check
Confirm the service is up by hitting the root endpoint:A running service returns:
Response
When the request succeeds, the service streams back a binary PDF withContent-Type: application/pdf and the filename highlighted.pdf. Save it directly to disk with --output in curl, or read the response bytes in your HTTP client of choice.
Error handling
| HTTP status | Meaning |
|---|---|
400 | Bad PDF URL (download failed) or no documents were provided |
422 | Invalid request payload — check that pdf_url is a string and documents is a non-empty array with the correct fields |
500 | Unexpected server-side error during highlighting |
All temporary files — both the downloaded PDF and the annotated output — are deleted automatically after each request via FastAPI background tasks. No files accumulate on the server between requests.