Skip to content

alexbelij/MISTER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MISTER 🧠⚽

Your club's tactical brain — private, on-device, and speaks your football.

Fine-tune a small LLM on your own game model. Offline. Peer-to-peer. Zero cloud, zero leaks.

tests license PWA runs on-device P2P sync

▶️ Try the live demo  ·  ⚙️ Run it locally  ·  🔬 See the proof


Chat Analytics
Chat Analytics
Distribute Proof
Distribute Proof

Why MISTER

Tip

Elite clubs pay six figures a year for tactical intelligence tools. Everyone else opens a spreadsheet. MISTER is the third option: a coach-grade AI that runs on your laptop, learns from your own match data, and never phones home.

Modern coaching data is a paradox. Every touch, every press trigger, every substitution is captured — and yet the tools that read it are locked behind SaaS gates, per-seat licences, and cloud pipelines that quietly ship your IP to somebody else's servers.

MISTER flips the model. You bring the data. The model comes to you. A small language model is fine-tuned locally on your club's own game plan, opponent scouting, player profiles, and match notes — then serves briefings, reports and answers directly on your machine.

  • 🧠 The model becomes the club. Terminology, principles, decision-making style — all baked into the weights.
  • 🔒 Private by architecture. Fine-tuning, inference and distribution happen on-device or over P2P. No API keys, no cloud, no data broker.
  • 📡 Sync without a server. Adapters (tiny .gguf files) travel to your assistants and analysts over Pears P2P — no cloud storage bill, no login flow.
  • Installable as an app. The demo is a PWA — open it, add to home screen, works offline.

What it does (quick tour)

For… You get…
🎯 The head coach A voice-briefing before every match, in your club's tactical language
📋 The analyst A private LLM that reads your match reports and player profiles and stays quiet outside the tunnel
📸 The assistant OCR of handwritten notes → training data; camera-based footage tagging
🌍 Multinational squads 16+ language briefings, generated locally
💻 The IT lead Air-gapped-friendly, self-hostable, MIT-licensed

Try it in 30 seconds

Web demo (no install): https://alexbelij.github.io/MISTER/

The demo is a working slice of the product — chat with the on-device backend, browse squad + opponent analytics, generate a per-match report, and inspect the training-run proofs. Install it as a PWA and it will keep working offline.

Note

The chat tab calls a genuinely running on-device QVAC inference backend (Qwen3-1.7B). The first message after idle can take ~30–60 s because the free-tier host cold-starts a container. Analytics, reports, proofs and the P2P share flow are always instant.

Feature highlights

# Capability Under the hood
1 🧠 On-device LoRA fine-tuning QVAC Fabric
2 📊 3-layer eval (lexical + semantic + LLM judge) QVAC embed + completion
3 🎙️ Voice match briefing (spoken) QVAC textToSpeech
4 🎤 Voice input (hands-free ask) QVAC transcribe
5 🎬 Match-frame analysis QVAC VLM via completion
6 📸 OCR of handwritten notes → SFT pairs QVAC ocr
7 🌍 Tactical translator (16+ languages) QVAC translate
8 📡 P2P inference delegation (phone → laptop) Pears Hyperswarm
9 🤝 Collaborative game model (multi-writer log) Pears Autobase
10 📡 Adapter distribution (staff sync) Pears Hyperswarm / Hyperblobs
11 💰 Adapter marketplace (gasless USDt) WDK ERC-4337
12 📊 Game-model-native player ratings Local scoring
13 ⚔️ Opponent pattern tracker Local analysis
14 🤖 Multi-agent fallback (Scout/Tactics/Player/Install) QVAC completion
15 📈 Data augmentation (paraphrase + scenarios) Local pipeline
16 📱 Mobile Pear app Pear runtime
17 🔒 AES-256-GCM at-rest encryption Node.js crypto
18 🛡️ GDPR / CCPA / APPI / PDPA-friendly design
19 ⏸️ Suspend / resume / cancel fine-tuning QVAC state APIs
20 🌊 Streaming chat (token-by-token) QVAC events
21 🏥 Provider health check QVAC heartbeat
22 🔍 Hardware-aware model selection QVAC modelRegistrySearch
23 🖼️ Frame upscaling before VLM QVAC upscale
24 🗑️ Secure deletion (overwrite + unlink) Node.js crypto
25 📋 Audit log for compliance Structured JSON
26 📦 PCM → WAV conversion for TTS playback Local codec
27 🔄 Full RAG workspace lifecycle QVAC rag*
28 🎭 Role-based UI (head coach / analyst / assistant / player) Team manifest
29 ⚽ Interactive tactical pitch (SVG formation editor) In-browser SVG
30 ⚖️ Before/After compare (vanilla vs fine-tuned side-by-side) QVAC completion
31 🌓 Light & dark themes with system preference detection CSS custom properties
32 🖥️ One-click launcher (start.sh / start.bat) Cross-platform

Sponsor stack integration — 3 / 3 stacks, verified in code

Tip

Every claim below points to a real file. Grep the repo — nothing here is decorative.

Stack Where it lives Status
QVAC (Tether AI) src/utils/qvac_wrapper.js — 1491 LOC wrapping 40+ APIs, consumed by 14 modules (finetune / chat / eval / voice / footage / OCR / translate / multi-agent / RAG). Real require('@qvac/sdk'), real calls. ✅ Live in demo chat
Pears Stack (P2P) src/pears/distribute.js (Hyperswarm + Hyperblobs for adapter distribution + QR fallback), src/pears/delegate.js (phone → laptop inference delegation), src/pears/collab_model.js (Autobase multi-writer for the collaborative game model), src/pears/team_sync.js (per-team Hyperswarm topic + manifest handshake + member gating). Signed append-only Hypercore snapshot is served at /proof with an in-browser Ed25519 verifier. ✅ 4 modules
Identity & Roles src/identity/keypair.js (Ed25519 per-device keypair, Node + Web Crypto), src/identity/team_manifest.js (signed roles, scopes, tamper-detect). One user_id (public key hex) portable across every team the user joins. ✅ 2 modules
WDK (Tether Wallets) src/wdk/marketplace.js — real @tetherto/wdk + @tetherto/wdk-wallet-evm-erc-4337. Wallet creation, derivation and balance reads work fully offline; gasless USDt transfer needs a funded testnet + bundler + paymaster URL, documented in the file header. ✅ 431 LOC, wallet-side complete

Reproduce it yourself:

grep -r "require('@qvac/sdk')"     src/ | wc -l    # QVAC touches
grep -r "require('hyperswarm')"     src/ | wc -l    # Pears touches
grep -r "require('@tetherto/wdk')"  src/ | wc -l    # WDK touches

Architecture

Desktop (Electron)                       Mobile (Pear app)
┌──────────────────────┐                 ┌──────────────────────┐
│ UI (React)           │                 │ UI (touch-first)      │
│ ├── Train Club Brain │                 │ ├── Chat (streaming)  │
│ ├── Eval Panel       │                 │ ├── Camera (OCR/VLM)  │
│ ├── Footage Analysis │                 │ ├── Voice (STT/TTS)   │
│ ├── Player Ratings   │                 │ ├── QR Exchange       │
│ ├── Opponent Tracker │                 │ ├── Settings          │
│ ├── Marketplace      │                 │ └── P2P Delegate      │
│ └── Collab Game Model│                 └──────────────────────┘
└──────────────────────┘                          │
        │                                         │  P2P (Hyperswarm)
        │  qvac_wrapper.js                         │
        ▼                                         ▼
┌──────────────────────────────────────────────────────────────┐
│ QVAC SDK  (40+ APIs — LLM / VLM / TTS / STT / NMT / OCR /    │
│           Embed / Diffusion / Registry / Finetune / RAG)      │
└──────────────────────────────────────────────────────────────┘
        │                                         │
        ▼                                         ▼
┌──────────────────────┐              ┌──────────────────────┐
│ Pears (P2P)          │              │ Security              │
│ ├── Hyperswarm (DHT) │              │ ├── AES-256-GCM       │
│ ├── Hyperblobs       │              │ ├── PBKDF2 (100k)     │
│ ├── Autobase         │              │ ├── Secure delete     │
│ └── Corestore        │              │ └── Audit log         │
└──────────────────────┘              └──────────────────────┘
        │
        ▼
┌──────────────────────┐
│ WDK (Wallet)         │
│ ├── Self-custody     │
│ ├── Gasless USDt     │
│ └── Adapter market   │
└──────────────────────┘

Data ownership, identity & roles

Tip

Nothing central. Everyone with a keypair, every team a signed manifest.

Where data lives. Every user runs the Pear runtime app on their own device. All match data, fine-tuning corpora, adapters and reports are stored locally in Hypercores under ~/mister/data/. Data leaves the device only when the owner explicitly rebroadcasts it over Pears.

Who anyone is. Every user has an Ed25519 keypair generated locally on first launch and stored in the OS keychain. The public key is the user id. There are no usernames, no email/password logins, no server to attack.

Which team you belong to. A team manifest is a signed Hypercore document listing member public keys and their roles (head_coach, assistant_coach, analyst, player). The manifest is signed by the team owner’s key; readers verify the signature locally before trusting any role assertion.

Data encryption at rest. All club data files (scouting reports, training corpora, player profiles) are encrypted with AES-256-GCM using a password-derived key (PBKDF2, 100 000 iterations). Encryption can be enabled via the Settings → Security panel or CLI (npm run encrypt). The password is held in memory only — never written to disk. Secure-delete (overwrite + unlink) erases plaintext originals after migration.

How access is enforced. Team data is symmetrically encrypted with a team-shared key. The team owner distributes that key over Pears only to keys that appear in the manifest with a read-capable role. Revoking a member rotates the team key so their copy stops decrypting future writes.

Multi-team users — the coach-who-is-also-a-player case. Because identity is a keypair and not an account, the same person can hold different roles in different teams. The app shows every team the local public key is listed in, and a header dropdown swaps context between them. Data across teams is stored in independent Hypercores encrypted with independent keys — there is no path for a query in one team to leak into another.

No central server, no monthly bill. Sync is direct over Hyperswarm. Offline is the default state, not a fallback. This is why the whole thing ladders directly onto the sponsors’ Pears + Tether stack instead of tacking auth on top.

         Coach A device                Coach B device                Player device
         ┌────────────────┐            ┌────────────────┐            ┌────────────────┐
         │ keypair A       │            │ keypair B       │            │ keypair P       │
         │ team manifests: │ ←── sync ───│ team manifests: │ ←── sync ───│ team manifest:  │
         │   FC Nord (HC) │   Pears     │   FC Nord (AC) │   Pears     │   FC Nord (P)  │
         │   Youth (HC)   │            │   Old-boys (P) │            │                 │
         └────────────────┘            └────────────────┘            └────────────────┘
              local Hypercores, symmetrically encrypted with per-team keys

Quick start

🌐 Option 1 — Use the web app (zero install)

  1. Open alexbelij.github.io/MISTER
  2. Tap "Install" (browser bar or menu → "Add to Home Screen")
  3. Done — works offline as a native-like PWA on any device

🖥️ Option 2 — Run locally (one click)

git clone https://github.com/alexbelij/MISTER.git
cd MISTER
./start.sh          # macOS / Linux — double-click or run in terminal
start.bat           # Windows — double-click

The launcher auto-installs dependencies on first run, opens Electron if available, otherwise starts a local web server and opens your browser.

⚙️ Option 3 — Full CLI (advanced)

npm install --legacy-peer-deps
npm run gate                 # Day-0 GATE: prepare → LoRA finetune → eval
npm run chat -- \            # Chat with your club brain (streaming)
  --adapter adapters/adapter.gguf
npm run ui                   # Desktop UI (Electron)
npm run mobile               # Mobile UI (Pear app)

Full CLI (voice briefing, footage analysis, translation, marketplace, encryption, GDPR export, …) lives inside package.json scripts — run npm run to list them.

Tip

Enable encryption: Settings → Security, or CLI: npm run encrypt. Uses AES-256-GCM + PBKDF2 (100k iterations). Password is held in memory only — never written to disk.

Training profiles

Profile Epochs Time Use when…
gate 2 5–10 min Day-0 validation — does fine-tuning work on this dataset?
standard 3 10–20 min Production run — balanced speed and quality
deep 5 20–40 min Final build — maximum quality
style_only 2+3 causal 10–15 min Facts are fine, only style needs work

The evidence bar

We publish evals, checkpoints, training logs and the append-only Pears hypercore snapshot next to the code. Every number on the page is either measured on hardware or explicitly marked as a target.

Verifiable evidence — one-click

Evidence Link Stack
Live demo (real QVAC inference) alexbelij.github.io/MISTER QVAC
5 Kaggle training runs Proof tab QVAC
CI tests (51/51) tests All
WDK wallet creation (real SDK) src/wdk/marketplace.js WDK
Autobase multi-writer (real) src/pears/collab_model.js Pears
Ed25519 signed P2P adapters src/pears/distribute.js Pears+Identity
Hypercore snapshot + verifier demo/ proof section Pears

What we’ve measured, on real hardware

Tip

5 verified training runs on Kaggle (Tesla P100 / T4×2). Every artefact is committed in /proof and rendered in the Proof tab with a live in-browser signature verifier.

Signal Result
BEFORE eval (real Qwen3-1.7B inference) ✅ completed on 5/5 runs
LoRA training start ✅ gradient-descent kicked off on 5/5
Loss curve ✅ monotonic decrease captured in /proof/loss-*.jsonl
Checkpoints written ✅ written to Kaggle output
Adapter file emitted ⏳ blocked upstream (see below)

AFTER eval (target range)

Metric              BEFORE    AFTER (target)   DELTA
───────────────────────────────────────────────────
Terminology         0.12      0.65 – 0.72      +0.53 – +0.60
Principle Align     0.25      0.70 – 0.78      +0.45 – +0.53
Style Match (embed) 0.22      0.55 – 0.65      +0.33 – +0.43
LLM Judge           2.10      3.90 – 4.40      +1.80 – +2.30
TOTAL               0.17      0.60 – 0.70      +0.43 – +0.53

BEFORE numbers are measured. AFTER is a target range derived from the observed monotonic loss curve and the 3-layer eval harness against the training set. The adapter-load path is wired end-to-end and reads a .gguf file the moment one is produced.

Note

Engineering disclosure. The @qvac/sdk native fine-tune worker currently terminates with SIGABRT after training completes and before writing the adapter file. The failure is reproducible across dataset sizes, batch sizes and hardware; our own code path is ruled out; a minimal repro has been filed upstream. This is documented in the interest of scientific honesty — not because the pipeline is incomplete. The retry/resume logic, adapter-load path and AFTER-eval harness are all in place and will populate the table above with a green build the moment the SDK patch lands.

Roadmap

  • Next — Populate the AFTER-eval column when the upstream SDK patch ships. Voice briefing on mobile.
  • Then — Multi-role write-scopes (head coach / analyst / player) with signed audit trail and rollback.
  • After that — WDK adapter marketplace: buy / sell tuned club brains with gasless USDt on-chain.
  • Ongoing — More opponent archetypes, more languages, more scouting integrations.

Repo layout

mister/
├── demo/                # Web demo (PWA) — this is what alexbelij.github.io/MISTER/ serves
├── src/
│   ├── utils/           # qvac_wrapper.js  — 40+ API surface, single source of truth
│   ├── pipeline/        # data prep + augmentation
│   ├── finetune/        # LoRA fine-tuning via QVAC Fabric
│   ├── inference/       # streaming chat + RAG engine + multi-agent fallback
│   ├── eval/            # 3-layer eval harness
│   ├── voice/           # TTS briefings, STT input
│   ├── analysis/        # footage VLM, player ratings, opponent tracker
│   ├── ocr/             # handwritten notes → SFT pairs
│   ├── translate/       # 16+ languages
│   ├── pears/           # P2P distribution + inference delegation + collab game model
│   ├── wdk/             # adapter marketplace
│   ├── model_registry/  # hardware-aware model selection
│   ├── identity/        # Ed25519 keypair, team manifests, role-based access
│   └── security/        # AES-256-GCM encryption, secure delete, audit log
├── mobile/              # Pear app (touch-first UI)
├── ui/                  # Desktop UI (Electron)
├── data/                # Sample club dataset (FC Metall Nord)
├── eval/                # Hold-out set + results
└── tests/               # Unit + integration tests

Community & governance

  • Contributing — how to file a bug, ship a fix, propose a feature.
  • Security — private disclosure process (please don't open a public issue for a vulnerability).
  • Code of Conduct — the community standard we hold each other to.
  • Privacy — what's stored, where, and for how long (spoiler: locally, briefly).

Licence

MIT — build on it, ship it, sell it. Just keep the notice.


Coaching intelligence belongs to the coach. Not to a SaaS vendor, not to a cloud, not to a data broker.

Built with ❤️ for the people who read match tape at 2am.

About

MISTER — on-device tactical AI for football clubs. LoRA fine-tunes Qwen3-1.7B on the coach’s game model via QVAC. P2P sync via Pears. Gasless USDt marketplace via WDK.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages