This guide explains how to configure the .env file for the LLM-agnostic Widerspruchsassistent.
23_RECHTSO/
├── .env # Your actual configuration (keep private!)
├── .env.example # Template with examples
└── ENV_README.md # This guide
-
Copy the example file:
cp .env.example .env
-
Edit
.envwith your actual API keys -
Never commit
.envto version control!
Choose your main LLM provider for chat and objection generation:
# Options: "mistral", "openai", "anthropic"
LLM_PROVIDER=mistralMistral is always required for OCR processing, even if you use a different provider for chat:
MISTRAL_API_KEY=your_actual_mistral_api_key
MISTRAL_MODEL=magistral-medium-2509 # or "ministral-8b-latest"
MISTRAL_OCR_MODEL=mistral-ocr-latestGet your Mistral API key: https://console.mistral.ai/
LLM_PROVIDER=mistral
MISTRAL_API_KEY=your_mistral_api_key
MISTRAL_MODEL=magistral-medium-2509LLM_PROVIDER=openai
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o-mini # or "gpt-4o" for visionGet your OpenAI API key: https://platform.openai.com/api-keys
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=your_anthropic_api_key
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022Get your Anthropic API key: https://console.anthropic.com/
MAX_FILE_SIZE_MB=10 # Maximum file size for uploadsCustomize the AI behavior for different use cases:
OBJECTION_SYSTEM_PROMPT="Du bist ein Experte für deutsche Sozialrecht und Verwaltungsrecht.
Erstelle präzise, rechtlich korrekte Widersprüche gegen Bescheide von Behörden."
DOCUMENT_CHAT_SYSTEM_PROMPT="Du bist ein Experte für deutsche Sozialrecht und Verwaltungsrecht.
Erkläre Dokumente verständlich und beantworte Fragen dazu."Customize the messages sent to the AI:
OBJECTION_USER_MESSAGE_TEMPLATE="Bitte erstelle einen Widerspruch gegen den Bescheid für folgende Leistungen:
{leistungen}
Verwende das hochgeladene Dokument als Grundlage für den Widerspruch."
DOCUMENT_CHAT_INITIAL_MESSAGE="Bitte analysiere dieses Dokument und erkläre mir den Inhalt verständlich."Customize error messages, disclaimers, and help text:
LEGAL_DISCLAIMER="⚠️ **Rechtlicher Hinweis**: Dieser Assistent erstellt nur Vorschläge für Widersprüche.
Lassen Sie diese von einem Anwalt prüfen, bevor Sie sie einreichen."
PRIVACY_NOTICE="🔒 **Datenschutz**: Ihre Dokumente werden nur zur Verarbeitung verwendet und nicht gespeichert."
ERROR_NO_API_KEY="API-Schlüssel nicht konfiguriert"
ERROR_NO_DOCUMENT="Kein Dokument geladen"
ERROR_DOCUMENT_PROCESSING="Fehler bei der Dokumentverarbeitung"DOCUMENT_EXPLANATION_PAGE_TITLE="Erkläre mein Dokument"
OBJECTION_CREATION_PAGE_TITLE="Erstelle einen Widerspruch"SERVICES_INPUT_HELP="Beschreiben Sie die Leistungen, die Sie beantragt haben"
DOCUMENT_PROCESSING_INFO="Das Dokument wurde mit OCR verarbeitet und kann nun analysiert werden."
# Example Questions (comma-separated)
EXAMPLE_QUESTIONS="Was steht in diesem Dokument?,Welche Fristen sind wichtig?,Was bedeutet dieser rechtliche Begriff?,Welche Schritte muss ich unternehmen?"
OBJECTION_CREATION_HELP="- **Leistungen beschreiben**: Beschreiben Sie die Leistungen, die Sie beantragt haben
- **Widerspruch erstellen**: Die KI erstellt automatisch einen formellen Widerspruch
- **Anpassen**: Sie können den Widerspruch nach Ihren Bedürfnissen anpassen"- Never commit
.envto version control - it contains sensitive API keys - The
.envfile is already included in.gitignore - Use
.env.exampleas a template for sharing configuration structure - Keep your API keys secure and rotate them regularly
- Copy
.env.exampleto.env - Replace
your_*_api_key_herewith your actual API keys - Customize any other values as needed
- Run the Streamlit application
The application will automatically load all configuration from the .env file using python-dotenv.
- No spaces around the
=sign:KEY=value - No quotes needed for simple values:
MAX_FILE_SIZE_MB=10 - Use quotes for multi-line values:
PROMPT="Line 1\nLine 2" - Comma-separated lists:
QUESTIONS="Q1,Q2,Q3"
- API key not working: Check that the key is correctly set in
.env - Configuration not loading: Ensure
.envfile is in the project root - Missing variables: Check that all required variables are set
- Syntax errors: Verify
.envfile format (no spaces around=)
The application includes built-in configuration validation. If required variables are missing, you'll see helpful error messages indicating what needs to be configured.