# Optional Pi agent backend credentials (copy to config/agent.env — do not commit secrets). # # Loaded by tools/config.py when APP_TYPE=agent (or legacy "pi"); set automatically by # agent-redact/pi/gradio_app.py, start.sh, and docker-compose pi-agent services. Override with # APP_CONFIG_PATH if needed. # APP_TYPE=agent also skips eager spaCy/Presidio load at startup (the agent orchestrates redaction remotely). # # Local Windows/macOS dev: leave unset to use {repo}/workspace (created automatically). # Docker: compose sets AGENT_WORKSPACE_DIR=/home/user/app/workspace # AGENT_WORKSPACE_DIR= # # Per-user session subfolders: {AGENT_WORKSPACE_DIR}/{gradio_session_hash}/ (default on). # Set false only if you want one shared workspace tree for all browser sessions. # AGENT_SESSION_WORKSPACE=true # per-browser subfolder under workspace/ (default when unset) # AGENT_SESSION_WORKSPACE=false # single shared workspace root (legacy) # # Skills: on startup, repo skills/ are copied to {AGENT_WORKSPACE_DIR}/.pi/skills/ (read-only). # Pi RPC uses --no-skills and loads only that folder; cwd is the session subfolder. # AGENT_SKILLS_RESYNC=true # force refresh from repo on next start # AGENT_SKILLS_WRITABLE=true # skip read-only chmod (local debugging) # # Gradio upload temp (must match GRADIO_TEMP_DIR; local default: workspace/.gradio_uploads) # AGENT_UPLOAD_ROOT= # GRADIO_TEMP_DIR= # # Pi Gradio listen port (default 7862 local-docker, 7860 hf-space). Not GRADIO_SERVER_PORT (main app). # AGENT_UI_PORT=7862 # # Monorepo root (skills/, config/). Usually auto-detected on Windows/macOS; Docker sets /workspace/doc_redaction. # AGENT_WORKDIR= # # Host-only: path to pi RPC CLI if not on PATH (Windows: ...\AppData\Roaming\npm\pi.cmd) # AGENT_EXECUTABLE= # # doc_redaction Gradio app for Pass 1 /doc_redact and review APIs (not the Pi UI above). # Local dev: main app on 7860 → DOC_REDACTION_GRADIO_URL=http://127.0.0.1:7860 # Docker compose: http://redaction-app-llama:7860 (see docker-compose_llama_agentic.yml) # DOC_REDACTION_GRADIO_URL=http://127.0.0.1:7860 # # When the main app keeps COGNITO_AUTH=True, set a dedicated Cognito user for gradio_client # (not the Pi UI user's session). Optional on Express+Pi: main backend auth is off by default. # DOC_REDACTION_GRADIO_AUTH_USER= # DOC_REDACTION_GRADIO_AUTH_PASSWORD= # # --- Intro / branding (Pi Gradio UI) --- # AGENT_GRADIO_TITLE=Agentic Document Redaction # AGENT_INTRO_TEXT=intros/pi_intro.txt # AGENT_INTRO_TEXT supports {USER_GUIDE_URL} and {AGENT_GRADIO_TITLE} when loading from a .txt file. # # Used by the pi-agent service in docker-compose_llama_agentic.yml. # UI overrides in the Gradio app apply for the current container session only. # Deployment profile: local-docker (default) | hf-space | aws-ecs (split container from doc_redaction) # AGENT_DEPLOYMENT_PROFILE=local-docker # On AWS ECS, Pi and doc_redaction are separate services — outputs are downloaded via # gradio_client HTTP, not by grepping /workspace on the Pi container (see doc-redaction-app §2f). # ECS/CDK typically sets AGENT_DEPLOYMENT_PROFILE=aws-ecs, AGENT_DEFAULT_PROVIDER=amazon-bedrock, # and AGENT_DEFAULT_MODEL=anthropic.claude-sonnet-4-6 via task env (overrides this file). # --- Agent orchestration backends (pi default | langgraph | agentcore) --- # AGENT_ORCHESTRATOR=pi # AGENT_ORCHESTRATOR=langgraph # AGENT_ORCHESTRATOR=agentcore # AGENTCORE_RUNTIME_URL=https://your-agentcore-runtime.example # See agent-redact/agentcore/README.md for deploy steps and how to obtain the URL. # AGENTCORE_API_KEY= # LANGGRAPH_REQUIRE_REVIEW_APPROVAL=true # Default Pi orchestration backend: llama-cpp | google-gemini | amazon-bedrock AGENT_DEFAULT_PROVIDER=llama-cpp # AGENT_DEFAULT_PROVIDER=amazon-bedrock # AGENT_DEFAULT_MODEL=anthropic.claude-sonnet-4-6 # AGENT_DEFAULT_MODEL=unsloth/Qwen3.6-27B-MTP-GGUF # Default redaction task settings (Gradio UI + agent prompt; see agent-redact/pi/redaction_prompt.py) # AGENT_DEFAULT_OCR_METHOD=hybrid-paddle-inference-server # AGENT_DEFAULT_PII_METHOD=Local # pi-bedrock compose profile overrides: AWS Textract service - all PDF types / AWS Comprehend # pi-gemini compose profile overrides: tesseract / Local # --- HF Space profile (AGENT_DEPLOYMENT_PROFILE=hf-space) --- # AGENT_DEFAULT_PROVIDER=google-gemini # AGENT_DEFAULT_MODEL=gemini-flash-latest # HF Space: point DOC_REDACTION_GRADIO_URL at your doc_redaction Space (see top of file). # HF_TOKEN= # auth to private redaction Space (Space secret on Pi Space) # DOC_REDACTION_HF_TOKEN= # alias mirrored to HF_TOKEN # Local llama-cpp (match AGENT_LLAMA_MODEL_ID to the active compose profile / llama.cpp -hf repo) # AGENT_LLAMA_BASE_URL=http://llama-inference:8080/v1 # AGENT_LLAMA_MODEL_ID=unsloth/Qwen3.6-27B-MTP-GGUF # --profile 27b_36 (pi-agent) # AGENT_LLAMA_MODEL_ID=unsloth/Qwen3.6-35B-A3B-GGUF # --profile 35b_36 (pi-agent-35b) # AGENT_LLAMA_MODEL_ID=unsloth/gemma-4-31B-it-GGUF # --profile gemma4-31b (pi-agent-gemma-31b) # AGENT_LLAMA_MODEL_ID=unsloth/gemma-4-26B-A4B-it-GGUF # --profile gemma4-26b (pi-agent-gemma-26b) # Google Gemini (Pi resolves GEMINI_API_KEY; GOOGLE_API_KEY is mirrored at startup) # GEMINI_API_KEY= # GOOGLE_API_KEY= # # Quota / rate-limit retries (Gradio UI loop and Pi auto-retry in settings.json; default 5) # AGENT_MAX_RETRIES=5 # AGENT_QUOTA_RETRY_DELAY_S=60 # AGENT_GEMINI_RETRY_BASE_DELAY_MS=60000 # AGENT_GEMINI_RETRY_MAX_DELAY_MS=90000 # Pi session auto-compaction (written to ~/.pi/agent/settings.json on startup) # AGENT_COMPACTION_ENABLED=true # AGENT_COMPACTION_RESERVE_TOKENS=32768 # AGENT_COMPACTION_KEEP_RECENT_TOKENS=20000 # AWS Bedrock (uses AWS SDK credential chain — not a single API key) # AWS_REGION=eu-west-2 # AWS_ACCESS_KEY_ID= # AWS_SECRET_ACCESS_KEY= # AWS_SESSION_TOKEN= # AWS_PROFILE=