The Compliance Layer for Real Estate AI Agent.
FairProp Inspector is a high-performance, latency-critical inference engine designed to detect Fair Housing Act (FHA) violations in real-time. Unlike legacy regex-based solutions, FairProp leverages Small Language Models (SLMs) fine-tuned on compliance datasets to understand context, nuance, and intent.
Built for the On-Device AI era, it runs efficiently on edge hardware while maintaining privacy-first architecture.
graph TD
A[FHA Rules & Heuristics] --> B[Synthetic Generator <i>(GPT-4o Distillation)</i>]
B --> C[(Synthetic Dataset)]
C --> D[ModernBERT Fine-tuning <i>(BF16 / FlashAttention)</i>]
D --> E{Model Serialization}
E --> F[PyTorch Checkpoint]
E --> G[ONNX Export <i>(Quantized)</i>]
G --> H[Edge Inference <i>(Browser/Embedded)</i>]
F --> I[Compliance API/Platform]
Part of the FairProp AI Platform ecosystem.
- SOTA Architecture: Powered by ModernBERT, delivering 8192 context length and Flash Attention backend.
- Edge-Native: Optimized for ONNX Runtime export, enabling sub-20ms latency on CPU.
- Data Engine: Includes a synthetic data generation pipeline (
scripts/generate_synthetic.py) utilizing LLM distillation (GPT-4o) to bootstrap compliance supervision. - Privacy-First: No data leaves your infrastructure. Full compliance checks happen locally.
git clone https://github.com/ZheWang-stack/FairProp-Inspector.git
cd FairProp-Inspector
pip install -e .pip install git+https://github.com/ZheWang-stack/FairProp-Inspector.gitNote
PyPI package coming soon! For now, please install from source.
FairProp Inspector bridges the gap between simple regex rules and expensive cloud APIs:
| Method | Latency | Accuracy | Privacy | Cost |
|---|---|---|---|---|
| Regex Rules | <1ms | ~65% | β Local | Free |
| Cloud API (GPT-4) | 800ms | ~95% | β Cloud | $$$$ |
| FairProp Inspector | ~18ms | ~94% | β Local | Free |
Benchmarks run on Intel i7-12700K CPU with ONNX Runtime optimization.
Get started in 30 seconds:
from src.inference.predict import predict
# Detect FHA violations instantly
text = "No kids under 12 allowed"
label, confidence = predict(text, "artifacts/model")
print(f"{label}: {confidence:.1%}")
# Output: NON_COMPLIANT: 99.8%Try it now:
python examples/quickstart.pyExplore our ready-to-run examples:
- Quick Start - 5 lines of code to get started
- Edge Inference - Production-ready with error handling and batch processing
- Batch Processing - Efficiently process multiple property listings
- Jupyter Tutorial - Interactive notebook with visualizations and performance analysis
See examples/README.md for detailed usage instructions.
Our pipeline moves away from "black box" APIs to measurable, controllable local inference.
- Synthetic Distillation: We use
gpt-4oto generate "Edge Case" violations (e.g., subtle steering like "Perfect for active adults"). - Training: We fine-tune
ModernBERT-baseusingbf16precision and gradient checkpointing. - Inference: The model classifies text segments as
COMPLIANTvsNON_COMPLIANTwith probability calibration.
Train the inspector on your proprietary or synthetic data.
# Uses Flash Attention & BF16 automatically if specific hardware is detected
python src/trainer/train.py --data data/processed/synthetic.json --epochs 5 --batch_size 16Bootstrap your dataset using our chain-of-thought distillation script.
export OPENAI_API_KEY="sk-..."
python src/generator/generate_data.py --count 1000 --output data/processed/synthetic_train.jsonpython src/inference/predict.py "No kids under 12 allowed in the specialized quiet zone."
# Output: [NON_COMPLIANT] 98.4% Confidence- Training Guide - Complete guide to training custom models with GPT-4 prompt templates
- Benchmarks - Performance comparison and accuracy testing
- Examples - Ready-to-run code samples
- ROADMAP - Project development plan and quarterly goals
- CHANGELOG - Version history and release notes
We welcome contributions from the community! Please see:
- CONTRIBUTING.md - Contribution guidelines and code standards
- CODE_OF_CONDUCT.md - Community guidelines
- Issue Templates - Bug reports and feature requests
This project is licensed under the MIT License.
Built with β€οΈ for Fair Housing Compliance
β Star us on GitHub |
π Report Bug |
π‘ Request Feature