legalsync / README.md
AnthropicallyHuggingFaces's picture
Add README (platform + deploy)
1f4f925 verified
|
Raw History Blame Contribute Delete
3.07 kB
---
title: LegalSync — AI-Platform v4
emoji: ⚖️
colorFrom: indigo
colorTo: green
sdk: docker
pinned: false
app_port: 7860
---
# LegalSync · AI-Platform v4 — Workload
**DataRobot + Groq + Chrome Secondary Brain.** A governed, any-HTTP-container
Workload (DataRobot Workload API) exposing the LegalSync reference app.
Live UI: landing page (`/`), interactive API docs (`/docs`), health (`/health`).
## What runs here
- **FastAPI workload** (`workload_app.py`) on port **7860**:
- `GET /health` — readiness + canary smoke test
- `POST /api/payments` — OmniPay (stripe / paypal / ach)
- `POST /api/transcription` — whisper pipeline (DPPA redaction)
- `POST /api/bond/recommend` — human-in-the-loop
- `POST /api/discovery/assemble` — Art 39.14 packets
- `POST /api/llm/chat` — DataRobot LLM Gateway / Groq routing (00-core)
- `GET /api/mcp/tools` — agentic MCP tool listing (40-agentic-ai)
## Repo layout (v4, deduped)
```
.
├── workload_app.py # FastAPI entry (Workload API compliant)
├── config/ # 8 JSONs — SINGLE SOURCE OF TRUTH
├── services/ # 9 processors + orchestrator agent
├── schemas/ # 4 JSON schemas
├── api/ # 3 OpenAPI YAMLs
├── docs/ # legal (10), compliance (4), runbooks (7), training, marketing
├── scripts/ # secondary-brain agents + cross-examine gate
├── ai-platform/900-registry/ # 10 YAMLs (providers, models, tools, rollouts, …)
├── datarobot-workload.yaml # dr CLI rollout (canary_then_progressive)
├── lighthouserc.json # Lighthouse CI budgets (secondary brain)
└── .github/workflows/ # ci-secondary-brain.yml
```
## Deploy
**Hugging Face (this Space):** Docker SDK — builds `Dockerfile`, serves on 7860.
**Local:**
```bash
pip install -r requirements.txt
uvicorn workload_app:app --host 0.0.0.0 --port 8000
# or
docker compose up --build # legalsync + lighthouse + prometheus + grafana
```
**DataRobot (Workload API — any HTTP container):**
```bash
export DATAROBOT_API_KEY=... GROQ_API_KEY=...
dr workload create --name legalsync --image legalsync:latest --port 8000
dr workload deploy --config datarobot-workload.yaml
```
> Requirement per docs.datarobot.com: the Workload API works with any container
> that listens on HTTP — deploy agent services, model inference, RAG pipelines,
> MCP servers and custom apps as governed Workloads.
## Quality gate (Secondary Brain)
Primary (build/test) **and** Secondary Brain must pass before production:
- Lighthouse CI — perf ≥ 0.9 · a11y 1.0 · LCP < 2500 · CLS < 0.1 (3 runs)
- Chrome DevTools MCP — console / network / CWV cross-examination
- Gate policy — `both_primary_and_secondary_must_pass` (`rollout_secondary_brain.yaml`)
## Single source of truth
`config/*.json` is authoritative; `docs/legal/*` and schemas *reference* config,
never redefine it (v4 dedupe rule). See `MERGED_TOOLBOX_v4.md` for the platform.