Downloads · 30 days
0
stellarproximology/Trident
Trident is a machine learning model from stellarproximology. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
~1M parameter transformer with three specialist heads: Code, Math, Research. Runs on CPU (Termux/iPad/laptop). Knowledge retrieval via P2P WebRTC — no cloud needed.
Downloads · 30 days
0
Access
Public
Updated Mar 26, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.pyc37.4 KB · 48%
From the Hugging Face model README
~1M parameter transformer with three specialist heads: Code, Math, Research. Runs on CPU (Termux/iPad/laptop). Knowledge retrieval via P2P WebRTC — no cloud needed.
model.py — Trident architecture (backbone + 3 heads + RAG gate)rag.py — Python chunk store + P2P RAG node (aiortc)rag_client.js — Browser P2P RAG client (WebRTC DataChannel)signal_server.py— Minimal WebSocket signaling (handshake only, ~50 lines)mcp_server.py — FastMCP server exposing all tools to Claude/any LLMtrain.py — Training loop (toy data → real data)# Install
pip install -r requirements.txt
# Test model architecture
python model.py
# Train on toy data (CPU, ~1 min)
python train.py
# Run MCP server (connect to Claude Desktop)
python mcp_server.py
# Run signaling server for P2P
python signal_server.py
Device A (your phone)
└─ TRIDENT_P2P.query("fibonacci")
└─ WebRTC DataChannel → Device B (iPad)
└─ Device B searches local chunks
└─ Returns top-K matches
└─ Device A merges local + peer results
└─ Top-K embeddings → RAGFusionGate → model generates
| Tool | What it does |
|---|---|
trident_generate | Generate text, pick head, optionally RAG |
trident_add_chunk | Add knowledge to RAG store |
trident_search_rag | Search chunks without generating |
trident_router | Predict which head fits a query |
trident_list_chunks | List all stored knowledge chunks |
Input → [Embedding + PositionalEncoding]
→ [Backbone: 4x TransformerBlock] ← shared
→ [HeadRouter] → softmax weights
→ ┌─────────────────────────────┐
│ RAGFusionGate (cross-attn) │ ← per head
│ 1x TransformerBlock │
│ LM Head → logits │
└─────────────────────────────┘ × 3 heads
→ weighted ensemble OR forced single head