Spaces:
Sleeping
Sleeping
Commit Β·
ebe877b
1
Parent(s): a617acd
feat: update Dockerfile and README for HuggingFace Spaces deployment
Browse files- README.md +29 -16
- docker/Dockerfile +2 -2
README.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
**AuditEnv is an OpenEnv-style reinforcement learning environment for autonomous compliance auditing.**
|
| 4 |
|
|
@@ -8,7 +18,7 @@ The environment simulates real audit workflows and exposes deterministic, graded
|
|
| 8 |
|
| 9 |
---
|
| 10 |
|
| 11 |
-
##
|
| 12 |
|
| 13 |
In Reinforcement Learning (RL), the loop works like this:
|
| 14 |
1. **State/Observation:** The environment gives the AI some data (e.g., procurement invoices, employee access logs).
|
|
@@ -19,12 +29,13 @@ AuditEnv provides this exact standardized simulation framework utilizing the Ope
|
|
| 19 |
|
| 20 |
---
|
| 21 |
|
| 22 |
-
##
|
| 23 |
|
| 24 |
- **The API (src/auditenv/server.py):** A FastAPI web server that acts as the "game engine". It has three main endpoints:
|
| 25 |
- POST /reset: Starts a new audit scenario.
|
| 26 |
- GET /state: Lets the AI look at the current documents/data.
|
| 27 |
-
- POST /step: The AI submits its action here, and the server replies with the
|
|
|
|
| 28 |
- **The Rules (src/auditenv/models.py):** Defines exactly what data looks like using Pydantic. It ensures the AI can only take specific actions: submit_finding, lag_human_review, or
|
| 29 |
oop.
|
| 30 |
- **The Logic & Referee (src/auditenv/grader.py):** This is the core of the environment. When the AI takes an action, this calculate a deterministic score between 0.0 (total failure) and 1.0 (perfect audit).
|
|
@@ -32,16 +43,16 @@ oop.
|
|
| 32 |
|
| 33 |
### Structure Tree
|
| 34 |
AI_AUDIT/
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
|
| 42 |
---
|
| 43 |
|
| 44 |
-
##
|
| 45 |
|
| 46 |
OpenEnv metadata is defined in openenv.yaml. All tasks return deterministic, normalized rewards from [0.0, 1.0].
|
| 47 |
|
|
@@ -51,7 +62,7 @@ OpenEnv metadata is defined in openenv.yaml. All tasks return deterministic, nor
|
|
| 51 |
|
| 52 |
---
|
| 53 |
|
| 54 |
-
##
|
| 55 |
|
| 56 |
We have successfully built the "game engine" and the levels!
|
| 57 |
|
|
@@ -63,13 +74,14 @@ We have successfully built the "game engine" and the levels!
|
|
| 63 |
|
| 64 |
---
|
| 65 |
|
| 66 |
-
##
|
| 67 |
|
| 68 |
Now that the simulator is built, the next steps are pure Machine Learning: hooking up LLMs to this environment and optimizing them.
|
| 69 |
|
| 70 |
### Phase A: The LLM Baseline
|
| 71 |
Our OpenAI baseline is currently blocked by quota limits.
|
| 72 |
-
- **Action:** Add billing credits to the OpenAI key, or swap out the OpenAI code in
|
|
|
|
| 73 |
- **Goal:** See what an unschooled, prompt-based LLM scores on Easy, Medium, and Hard.
|
| 74 |
|
| 75 |
### Phase B: The Reinforcement Learning (RL) Pipeline
|
|
@@ -84,7 +96,7 @@ Right now, the AI only parses text/tabular data.
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
##
|
| 88 |
|
| 89 |
### 1) Create environment and install dependencies
|
| 90 |
Using uv (recommended):
|
|
@@ -97,4 +109,5 @@ uv pip install -r requirements.txt
|
|
| 97 |
|
| 98 |
uvicorn auditenv.server:app --reload --app-dir src
|
| 99 |
|
| 100 |
-
*(Endpoints available: GET /health, POST /reset, POST /step, GET /state)*
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Corp AI
|
| 3 |
+
emoji: π’
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- openenv
|
| 10 |
+
---
|
| 11 |
+
# π AuditEnv
|
| 12 |
|
| 13 |
**AuditEnv is an OpenEnv-style reinforcement learning environment for autonomous compliance auditing.**
|
| 14 |
|
|
|
|
| 18 |
|
| 19 |
---
|
| 20 |
|
| 21 |
+
## ?? What is AuditEnv? (The Core Concept)
|
| 22 |
|
| 23 |
In Reinforcement Learning (RL), the loop works like this:
|
| 24 |
1. **State/Observation:** The environment gives the AI some data (e.g., procurement invoices, employee access logs).
|
|
|
|
| 29 |
|
| 30 |
---
|
| 31 |
|
| 32 |
+
## ??? How the Codebase is Structured
|
| 33 |
|
| 34 |
- **The API (src/auditenv/server.py):** A FastAPI web server that acts as the "game engine". It has three main endpoints:
|
| 35 |
- POST /reset: Starts a new audit scenario.
|
| 36 |
- GET /state: Lets the AI look at the current documents/data.
|
| 37 |
+
- POST /step: The AI submits its action here, and the server replies with the
|
| 38 |
+
eward and whether the audit is done.
|
| 39 |
- **The Rules (src/auditenv/models.py):** Defines exactly what data looks like using Pydantic. It ensures the AI can only take specific actions: submit_finding, lag_human_review, or
|
| 40 |
oop.
|
| 41 |
- **The Logic & Referee (src/auditenv/grader.py):** This is the core of the environment. When the AI takes an action, this calculate a deterministic score between 0.0 (total failure) and 1.0 (perfect audit).
|
|
|
|
| 43 |
|
| 44 |
### Structure Tree
|
| 45 |
AI_AUDIT/
|
| 46 |
+
+-- configs/ # YAML configs for dataset mapping & reward logic
|
| 47 |
+
+-- data/ # Local dataset folder (ignored in git)
|
| 48 |
+
+-- docker/ # Dockerization for the environment
|
| 49 |
+
+-- scripts/ # Baselines and data checkers
|
| 50 |
+
+-- src/auditenv/ # Core environment server, State, Models, and Graders
|
| 51 |
+
+-- tests/ # Unit and smoke tests
|
| 52 |
|
| 53 |
---
|
| 54 |
|
| 55 |
+
## ?? Tasks & Difficulty Levels
|
| 56 |
|
| 57 |
OpenEnv metadata is defined in openenv.yaml. All tasks return deterministic, normalized rewards from [0.0, 1.0].
|
| 58 |
|
|
|
|
| 62 |
|
| 63 |
---
|
| 64 |
|
| 65 |
+
## ? Current Status (As of April 2026)
|
| 66 |
|
| 67 |
We have successfully built the "game engine" and the levels!
|
| 68 |
|
|
|
|
| 74 |
|
| 75 |
---
|
| 76 |
|
| 77 |
+
## ??? What Needs to be Done Next (Roadmap)
|
| 78 |
|
| 79 |
Now that the simulator is built, the next steps are pure Machine Learning: hooking up LLMs to this environment and optimizing them.
|
| 80 |
|
| 81 |
### Phase A: The LLM Baseline
|
| 82 |
Our OpenAI baseline is currently blocked by quota limits.
|
| 83 |
+
- **Action:** Add billing credits to the OpenAI key, or swap out the OpenAI code in
|
| 84 |
+
un_baseline.py for a free local model (like Llama-3 or Mistral) using Ollama/vLLM.
|
| 85 |
- **Goal:** See what an unschooled, prompt-based LLM scores on Easy, Medium, and Hard.
|
| 86 |
|
| 87 |
### Phase B: The Reinforcement Learning (RL) Pipeline
|
|
|
|
| 96 |
|
| 97 |
---
|
| 98 |
|
| 99 |
+
## ??? Setup & Installation
|
| 100 |
|
| 101 |
### 1) Create environment and install dependencies
|
| 102 |
Using uv (recommended):
|
|
|
|
| 109 |
|
| 110 |
uvicorn auditenv.server:app --reload --app-dir src
|
| 111 |
|
| 112 |
+
*(Endpoints available: GET /health, POST /reset, POST /step, GET /state)*
|
| 113 |
+
|
docker/Dockerfile
CHANGED
|
@@ -14,6 +14,6 @@ COPY scripts ./scripts
|
|
| 14 |
# Create data directory (fallback synthetic data will be used if empty)
|
| 15 |
RUN mkdir -p data
|
| 16 |
|
| 17 |
-
EXPOSE
|
| 18 |
|
| 19 |
-
CMD ["uvicorn", "auditenv.server:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 14 |
# Create data directory (fallback synthetic data will be used if empty)
|
| 15 |
RUN mkdir -p data
|
| 16 |
|
| 17 |
+
EXPOSE 7860
|
| 18 |
|
| 19 |
+
CMD ["uvicorn", "auditenv.server:app", "--host", "0.0.0.0", "--port", "7860", "--app-dir", "src"]
|