A Python-based web application for analyzing uploaded documents using an LLM
1.0K
š docker-compose.yml
version: '3.8'
services:
document-analyzer:
image: fybre/document-analyzer:latest
ports:
- "8000:8000"
env_file:
- .env
volumes:
- ./temp_uploads:/app/temp_uploads #OPTIONAL
restart: unless-stopped
š .env file (same directory as docker-compose.yml) .env
LLM_BACKEND=azure
LLM_MODEL=gpt-35-turbo
AZURE_OPENAI_KEY=your-azure-api-key
AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com/
AZURE_DEPLOYMENT_NAME=your-deployment-name
Replace the values with your actual configuration. You can also use OpenAI or Ollama by changing LLM_BACKEND and providing relevant keys or access.
docker-compose up
Access the API at: http://localhost:8000/docsā
You can configure these directly or via a .env file.
Variable Description
LLM_BACKEND azure, openai, or ollama
LLM_MODEL Model name (llama2, gpt-4, gpt-35-turbo, etc.)
OPENAI_API_KEY OpenAI API key (if using OpenAI backend)
AZURE_OPENAI_KEY Azure API key (if using Azure backend)
AZURE_OPENAI_ENDPOINT Azure OpenAI endpoint
AZURE_DEPLOYMENT_NAME Azure deployment name
POST /analyze
Upload a document and receive analysis as structured JSON.
š Parameters
file: (required) File upload (.pdf or .txt)
additional_llm_prompt: (optional) Extra context or task instruction
custom_system_prompt: (optional) Override the default system prompt
Responses follow a strict JSON schema, for example:
{
"document_type": "resume",
"score": 85,
"summary": {
"concise": "Experienced software engineer.",
"detailed": "The document describes a senior developer with experience in Python..."
},
"recommendations": "Add specific skills to improve score.",
"error": {
"code": "",
"message": null
}
}
Content type
Image
Digest
sha256:875ce3dc8ā¦
Size
73.1 MB
Last updated
about 1 year ago
docker pull fybre/document-analyzer