EdgeRoute
by Kedar7412
README.md
Here is the complete text.
Open Notepad with:
cmd
notepad README.md
Press Ctrl + A, press Delete, then copy and paste this entire block into Notepad, save (Ctrl + S), and close Notepad:
markdown
# EdgeRoute ā”
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io/)
> A sub-millisecond, self-improving "System 1" edge decision engine for AI IDEs and agents (Kiro, Cursor, Claude Code, Windsurf, Cline).
EdgeRoute is a local Model Context Protocol (MCP) server that evaluates developer intent in **under 2 milliseconds** using an on-device linear projection head. Instead of sending every repetitive routing decision to expensive cloud LLMs, EdgeRoute classifies actions locally, abstains when uncertain, and continuously fine-tunes itself on your machine via online stochastic gradient descent (SGD).
---
## š Key Advantages
- **ā” Sub-Millisecond Decisions:** Evaluates state in `< 2 ms` on local CPU (L1/L2 cache), with zero network latency.
- **š”ļø Calibrated Abstention Gate:** Rejects false positives by abstaining whenever confidence is below `60%`, delegating complex reasoning to standard LLMs.
- **š Local Experience Replay & On-Device SGD:** Automatically adapts to your unique workflow by logging outcomes to an encrypted local SQLite buffer and running background mini-batch SGD.
- **š Measurable ROI Telemetry:** Tracks lifetime tokens saved, developer latency eliminated, and estimated cloud cost reductions in real time.
- **š 100% Private & Offline:** Never transmits your code, prompts, or weights to external cloud servers.
---
## šļø Architecture
User Prompt / Code Context ā ā¼ [ Deterministic Feature Hasher ] (zlib CRC32 / 128-d Vector) ā ā¼ [ Linear Softmax Head (CPU) ] (< 0.5 ms execution) ā āāāāāāā“āāāāāāāāāāāāāāāāāāāāāā ā¼ ā¼ Confidence >= 60% Confidence < 60% Instant Tool Execution Abstain (Fallback to Cloud LLM) ā ā¼ [ User Feedback Signal ] ā ā¼ [ Local SQLite Replay Buffer ] ā ā¼ (Continuous Background Daemon) [ Mini-Batch SGD Weight Update ]
---
## š¦ Quickstart
### 1. Clone & Setup
```bash
git clone https://github.com/Kedar7412/edgeroute-mcp.git
cd edgeroute-mcp
python -m venv venv
Activate virtual environment:
Windows: venv\Scripts\activate
macOS / Linux: source venv/bin/activate
2. Install Dependencies
bash
pip install -r requirements.txt
3. Seed Baseline Intelligence
bash
python seed_anchors.py
4. Interactive Live Test
bash
python interactive.py
š Client Setup Guides
1. Kiro
Add to your Kiro user config (Ctrl + Shift + P ā Kiro: Open user MCP config (JSON)):
json
{
"mcpServers": {
"edgeroute": {
"command": "python",
"args": ["/absolute/path/to/decision_engine_mcp.py"],
"disabled": false,
"autoApprove": ["*"]
}
}
}
To make Kiro automatically query EdgeRoute on every prompt without manual commands, create .kiro/steering/edgeroute.md:
markdown
---
inclusion: always
---
Before taking actions, query `route_decision` from `edgeroute`. If `abstained` is false, follow the recommended action. Log outcomes using `log_outcome`.
2. Cursor
Create or edit .cursor/mcp.json in your workspace root:
json
{
"mcpServers": {
"edgeroute": {
"command": "python",
"args": ["/absolute/path/to/decision_engine_mcp.py"]
}
}
}
3. Claude Desktop
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
json
{
"mcpServers": {
"edgeroute": {
"command": "python",
"args": ["/absolute/path/to/decision_engine_mcp.py"]
}
}
}
4. Claude Code (CLI)
Add to your global Claude CLI configuration (~/.claude.json):
json
{
"mcpServers": {
"edgeroute": {
"command": "python",
"args": ["/absolute/path/to/decision_engine_mcp.py"]
}
}
}
5. Windsurf / Codeium
Open Settings ā MCP Servers and add:
json
{
"mcpServers": {
"edgeroute": {
"command": "python",
"args": ["/absolute/path/to/decision_engine_mcp.py"]
}
}
}
6. VS Code (Cline / Roo Code)
In the Cline MCP settings tab, click Add New MCP Server and paste the JSON configuration.
š ļø MCP Tools Reference
Tool Parameters Description
route_decision context: string Evaluates prompt context in < 2 ms and returns top action, probabilities, and abstention status.
log_outcome context: string, selected_action: string, accepted: bool Logs user acceptance or override into the local SQLite replay buffer for future fine-tuning.
train_head epochs: int, batch_size: int Executes local mini-batch SGD on accumulated experience and commits updated weights.
get_savings_report (none) Returns a lifetime ROI summary showing tokens saved, time saved, and monetary value generated.
š License
Distributed under the MIT License. See LICENSE for more information.
---
### Push it to GitHub
After saving and closing Notepad, run these 3 commands in your terminal:
```cmd
git add README.md
git commit -m "docs: update full README documentation"
git pushThis server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues