sagar-03/invoice-processing-agent
0
๐งพ Invoice Processing Agent โ OpenEnv
An OpenEnv environment where an AI agent processes invoices and decides whether to approve, reject, or flag them for human review.
Why This Problem?
Invoice processing is one of the most time-consuming tasks in any organization. Finance teams manually review hundreds of invoices weekly, checking for duplicates, anomalies, missing fields, and fraud signals. This environment simulates that workflow so AI agents can learn to automate it.
Action Space
Observation Space
Tasks
Reward Function
Reward range: (0, 1] (Strictly between 0 and 1 as per Phase 2 requirements)Baseline Scores
Setup & Usage
Local
pip install -r requirements.txt
python -m uvicorn server.app:app --reload --port 7860With uv (recommended)
uv sync
uv run serverDocker
docker build -t invoice-env .
docker run -p 7860:7860 invoice-envRun Inference
Linux / macOS:
export API_BASE_URL=https://router.huggingface.co/v1
export MODEL_NAME=meta-llama/Llama-3.1-8B-Instruct
export HF_TOKEN=hf_your_token_here
export ENV_URL=https://sagar-03-invoice-processing-agent.hf.space
python inference.pyWindows (PowerShell):
$env:API_BASE_URL="https://router.huggingface.co/v1"
$env:MODEL_NAME="meta-llama/Llama-3.1-8B-Instruct"
$env:HF_TOKEN="hf_your_token_here"
$env:ENV_URL="https://sagar-03-invoice-processing-agent.hf.space"
python inference.pyEnvironment Variables
API Endpoints
Example Usage
import requests
BASE = "http://localhost:7860"
# Start episode
obs = requests.post(f"{BASE}/reset", json={"task_name": "easy_triage"}).json()
while not obs["done"]:
# Agent decides
action = {"decision": "approve", "reason": "Looks valid"}
result = requests.post(f"{BASE}/step", json=action).json()
obs = result["observation"]
print(obs["message"])
# Get final score
score = requests.post(f"{BASE}/grader").json()
print(f"Score: {score['score']}")