Simplifying Canadian government webpages into plain language with local AI
MapleClear is a browser extension that uses local AI inference to simplify complex government text and translate it into multiple languages, making Canadian government information more accessible to all citizens.
Submitted to the OpenAI Open Model Hackathon Categories: For Humanity (primary), Best Local Agent (secondary), Most Useful Fine-Tune (secondary)
- Plain Language Simplification: Convert complex government jargon into Grade 7 reading level
- Multi-Language Translation: Translate to French, Spanish, Chinese, Punjabi, Arabic, and more
- Split-Screen View: Compare original and simplified/translated content side-by-side
- Acronym Detection: Hover tooltips for government acronyms (CRA, EI, GST, etc.)
- Local or Cloud AI: Run fully on-device (llama.cpp, LM Studio, Hugging Face, vLLM) or use the Groq API for speed. The popup always says which one is active, because with Groq the page text is sent to Groq's servers
- Government Site Integration: Optimized for Canada.ca and gc.ca domains
- Popup Interface (
popup.html,popup.js): Main extension UI with action selection - Split-Screen Mode (
content-script.ts): Side-by-side comparison of original vs processed content - Panel View (
panel.html,panel.js): Advanced processing options and results - Background Service (
background.ts): Extension lifecycle and server status monitoring - Manifest V3 (
manifest.json): Modern extension configuration
server/
βββ app.py # FastAPI server with health checks and CORS
βββ backends/ # Pluggable AI inference backends
β βββ base.py # Abstract backend interface
β βββ groq_backend.py # Groq API integration (default)
β βββ huggingface_backend.py # Local transformers
β βββ lmstudio_backend.py # LM Studio integration
β βββ vllm_backend.py # vLLM for production
β βββ llama_cpp.py # llama.cpp integration
βββ prompts/
βββ schema.py # Response models and validation
All AI backends implement the same interface:
simplify()- Convert to plain languagetranslate()- Multi-language translationexpand_acronyms()- Government acronym definitionsget_model_info()- Backend status and capabilities
- Groq API: Fast cloud inference (default for demos)
- Local Models: gpt-oss-20b, Llama 2/3, Mistral
- Apple Silicon: Optimized through LM Studio integration
- Quantization: 8-bit/16-bit for resource efficiency
Server:
cd server
pip install -r requirements-minimal.txtExtension:
cd extension
npm install
npm run buildUsing Groq:
./setup.sh
make dev-serverOR
export GROQ=your_groq_api_key
python -m uvicorn server.app:app --host 127.0.0.1 --port 11434Using Local Models:
export MAPLECLEAR_BACKEND=huggingface
export MAPLECLEAR_MODEL_PATH=openai/gpt-oss-20b
python -m uvicorn server.app:app --host 127.0.0.1 --port 11434- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
extension/distfolder - Visit a Canada.ca page and click the MapleClear icon
export MAPLECLEAR_BACKEND=groq # Groq API (fast)
export MAPLECLEAR_BACKEND=lmstudio # LM Studio (Apple Silicon optimized)
export MAPLECLEAR_BACKEND=huggingface # Local transformers
export MAPLECLEAR_BACKEND=vllm # Production inferencecd extension
npm run dev # Watch mode for development
npm run build # Production build# Test server
cd server && python -m pytest
# Test extension
cd extension && npm test
# Demo page
open demo/canada-benefits.htmlMapleClear/
βββ README.md
βββ LICENSE # Apache 2.0 license
βββ Makefile # Build automation
βββ setup.sh # Environment setup
βββ .env # Environment variables
βββ .gitignore # Git ignore patterns
β
βββ server/ # FastAPI backend
β βββ app.py # Main server application
β βββ requirements.txt # Full dependencies
β βββ requirements-minimal.txt # Minimal setup
β βββ backends/ # AI inference backends
β β βββ __init__.py
β β βββ base.py # Abstract backend class
β β βββ groq_backend.py # Groq API integration
β β βββ huggingface_backend.py # Local transformers
β β βββ lmstudio_backend.py # LM Studio integration
β β βββ vllm_backend.py # vLLM inference
β β βββ llama_cpp.py # llama.cpp integration
β βββ prompts/
β βββ schema.py # Pydantic models
β
βββ extension/ # Browser extension
β βββ package.json # Extension dependencies
β βββ vite.config.ts # Build configuration
β βββ tsconfig.json # TypeScript configuration
β βββ src/
β β βββ manifest.json # Extension manifest (MV3)
β β βββ popup.html # Extension popup UI
β β βββ popup.js # Popup functionality
β β βββ popup.css # Popup styling
β β βββ panel.html # Advanced panel UI
β β βββ panel.js # Panel functionality
β β βββ panel.css # Panel styling
β β βββ content-script.ts # Page interaction logic
β β βββ content-styles.css # Content script styling
β β βββ background.ts # Service worker
β β βββ browser-polyfill.js # Cross-browser compatibility
β βββ dist/ # Built extension files
β
βββ tools/
β βββ seed_terms.py # Government acronym database
β
βββ demo/
βββ canada-benefits.html # Test page with government content
# Server Configuration
MAPLECLEAR_BACKEND=groq # AI backend selection
MAPLECLEAR_MODEL_PATH=openai/gpt-oss-20b # Model path
MAPLECLEAR_HOST=127.0.0.1 # Server host
MAPLECLEAR_PORT=11434 # Server port
# API Keys (if using cloud backends)
GROQ=your_groq_api_key # Groq API key
# Database
MAPLECLEAR_TERMS_DB=data/terms.sqlite # Acronym database| Backend | Use Case | Requirements |
|---|---|---|
groq |
Fast demos, cloud inference | API key |
lmstudio |
Apple Silicon local inference | LM Studio app |
huggingface |
Local transformers | GPU/CPU, 8GB+ RAM |
vllm |
Production deployment | GPU, high memory |
llama.cpp |
CPU inference | Compiled llama.cpp |
- Understand tax documents and benefit applications
- Navigate government services in plain language
- Access information in your preferred language
- Learn government acronyms and terminology
- Improve accessibility and comprehension
- Reduce support calls and clarification requests
- Meet plain language standards
- Support diverse linguistic communities
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- OpenAI for the gpt-oss models used in development and hosting the Open Model Hackathon
- Hackathon sponsors HuggingFace, Ollama, vLLM, NVIDIA, LM Studio
- Groq for providing free API credits to hackathon participants (needed for my testing)
- Government of Canada for open data and plain language initiatives
- The open source AI community for tools and inspiration