// projet phare — privé

JARVIS

ASSISTANT IA LOCAL  ·  ARCHITECTURE IRON MAN  ·  INTÉGRATION SOC

Python 3.11 · Flask Ollama · phi4:14b edge-tts · Whisper RTX 5080 · CUDA 12 ~3000 lignes PY · ~17K lignes UI
// architecture générale

$ cat architecture.json

JARVIS est un serveur Flask local exposant une interface web holographique. Il orchestre plusieurs moteurs IA en local et en cloud, avec un pipeline audio complet (STT → LLM → DSP → TTS) et une intégration bidirectionnelle avec le dashboard SOC.

🎙 Microphone
──
STT — faster-whisper
modèle small · FR
──▶
⬡ JARVIS CORE
Flask · Python 3.11
◀──
⌨ Chat UI
Interface web
Ollama local
phi4:14b · qwen2.5
mistral · gemma3
◀──▶
LLM
ROUTER
◀──▶
Cloud LLM
Groq · OpenRouter
fallback auto
DSP AUDIO RACK
EQ 5 bandes · Compresseur
Haas stéréo · DeepFilterNet
──▶
TTS ENGINE
edge-tts (défaut)
Piper · Kokoro · SAPI5
──▶
🔊 Audio
🛡 Tool Calling
Blocklist LLM
garde-fou niv. 1 & 2
──▶
◈ SOC INTEGRATION
ban-ip · unban-ip
restart-service
──▶
CrowdSec
Reverse Proxy VM
// stack technique

$ cat stack.txt

⬡ MOTEUR LLM
Ollama local — phi4:14b (défaut), qwen2.5, mistral, gemma3
Groq Cloud — fallback API OpenAI-compatible
OpenRouter — accès multi-modèles cloud
Streaming SSE — réponses token par token
Paramètres persistés — temperature, top_p, num_ctx, num_predict
Préréglages — RAPIDE / ÉQUILIBRÉ / QUALITÉ
🔊 PIPELINE TTS
edge-tts — fr-CA-AntoineNeural (défaut), streaming audio
Piper — synthèse vocale hors-ligne
Kokoro — moteur TTS alternatif
SAPI5 / pyttsx3 — TTS natif Windows
TTS Lock — threading.Lock anti-doublon vocal
Voice Lab — comparateur A/B, présets EQ
🎙 STT — RECONNAISSANCE VOCALE
faster-whisper — modèle "small", langue FR
Traitement local — aucune donnée envoyée vers le cloud
Activation — bouton micro dans l'interface Chat
🎛 DSP AUDIO RACK
EQ biquad 5 bandes — traitement fréquentiel précis
Compresseur dynamique — contrôle de la dynamique vocale
Haas stéréo — spatialisation du son
DeepFilterNet — débruitage IA temps réel
VU-mètres LCD — niveaux dB L/R temps réel
Mémoires M1–M10 — sauvegarde/rappel présets
🛡 TOOL CALLING & GARDE-FOU
Blocklist niveau 1 — noms d'outils interdits par le LLM
Blocklist niveau 2 — arguments interdits dans les appels
Journal — chaque tentative bloquée est loggée
Route /api/security — exposition dans le SOC dashboard
📊 MONITORING SYSTÈME
GPU RTX 5080 — P-state, PCIe gen/width, VRAM, watts, throttle
pynvml — stats NVIDIA temps réel
CPU / RAM — charge système locale
Terminal intégré — cmd/PowerShell avec historique
Explorateur fichiers — analyse IA de code
// interface holographique

$ ls ~/tabs/

Interface web holographique v3.2 — ~17 000 lignes HTML/CSS/JS. Thème cyberpunk Iron Man avec preloader typewriter, scan lines et effets lumineux.

◈ Chat IA
Conversation LLM streaming, TTS auto, STT microphone, tool calling, recherche DDG
⚙ Settings
Paramètres LLM (temp/top_p/num_ctx), profils prompt, provider IA, préréglages latence
🎛 DSP Audio
AI Audio Rack — EQ 5 bandes, compresseur, Haas stéréo, analyseur spectral, moteur TTS
🎵 Audio Editor
Éditeur audio IA — waveform L/R, transport, EQ, fade in/out, débruitage, export
🔬 Voice Lab
Synthèse vocale — moteur TTS, paramètres, EQ, présets, comparateur A/B
📊 Monitor
Stats temps réel CPU/RAM/GPU RTX 5080 — P-state, PCIe, throttle, bandwidth, watts
💻 Terminal
Shell intégré cmd/PowerShell, historique de navigation, taille police ajustable
📁 Fichiers
Explorateur lecteurs, breadcrumb, éditeur de code, bouton "◈ JARVIS" analyse IA
⏱ Tâches
Tâches automatisées avec scheduling et exécution planifiée
// intégration soc dashboard

$ cat soc-integration.md

JARVIS s'intègre dans le SOC Dashboard en tant que moteur d'analyse IA. Il expose des routes REST qui permettent au dashboard de déclencher des analyses LLM et d'exécuter des actions de sécurité via CrowdSec sur le reverse proxy. JARVIS est optionnel — le SOC reste 100% fonctionnel sans lui.

Méthode Route Usage SOC
GET/api/gpuStats GPU → tuile RTX 5080 dans le dashboard
POST/api/chatAnalyse LLM des données SOC (auto-engine 60s)
GET/api/ttsLecture vocale des alertes SOC (edge-tts)
GET/api/securityJournal blocklist LLM → tuile GARDE-FOU
POST/api/soc/ban-ipBan IP via CrowdSec sur le reverse proxy
POST/api/soc/unban-ipLève un ban CrowdSec
POST/api/soc/restart-serviceRedémarre un service autorisé
GET/api/soc/actionsJournal des actions proactives → tuile SOC
// triggers auto-engine (déclenché chaque 60s)
⚡ Activité anormale
+15 événements vs dernier check
⚠ Alerte CPU
CPU Windows > 90%
⚠ Alerte IPs
IPs bannies > 100
⚠ Erreurs serveur
Erreurs 5xx > 5%
📋 Résumé quotidien
Chaque jour à 08h00
// déploiement — méthode de mise en production

$ cat deploy.md

Déploiement local sur machine Windows avec GPU NVIDIA. Python 3.11, Ollama, edge-tts et faster-whisper forment la colonne vertébrale. La configuration se fait via fichiers JSON — aucune variable d'environnement système requise.

01
Prérequis
Python 3.11+
NVIDIA GPU (CUDA 12)
Ollama installé
02
Dépendances
pip install
flask edge-tts
faster-whisper pynvml
03
Modèles LLM
ollama pull [model]
Détection auto
au démarrage
04
Config JSON
providers.json
llm_params.json
dsp_params.json
05
Lancement
python jarvis.py
→ localhost:5000
navigateur
06
Intégration SOC
URL JARVIS dans
SOC dashboard
Routes /api/soc/*
// structure du projet
scripts/
├── jarvis.py              # Serveur Flask principal (~3 000 lignes)
├── templates/
│   └── jarvis.html        # Interface UI holographique (~17 000 lignes)
├── jarvis_providers.json  # Providers LLM + clés API (non versionné)
├── jarvis_llm_params.json # Paramètres LLM : temp, top_p, num_ctx, num_predict
└── jarvis_dsp_params.json # Paramètres DSP + moteur TTS actif
// installation des dépendances
# Dépendances principales
pip install flask flask-cors requests psutil

# TTS — synthèse vocale
pip install edge-tts pyttsx3

# STT — reconnaissance vocale
pip install faster-whisper

# GPU monitoring (NVIDIA)
pip install pynvml

# Optionnel — Piper TTS hors-ligne
# Télécharger le binaire depuis github.com/rhasspy/piper
// jarvis_providers.json — template (remplacer les [PLACEHOLDERS])
{
  "active_provider": "ollama",
  "providers": {
    "ollama": {
      "base_url": "http://localhost:11434",
      "model": "[MODEL_NAME]"       // ex: phi4:14b
    },
    "groq": {
      "api_key": "[GROQ_API_KEY]",
      "model": "[GROQ_MODEL]"        // ex: llama-3.3-70b-versatile
    },
    "openrouter": {
      "api_key": "[OPENROUTER_API_KEY]",
      "model": "[OPENROUTER_MODEL]"  // ex: anthropic/claude-3.5-sonnet
    }
  }
}
// jarvis_llm_params.json — paramètres LLM
{
  "temperature":  0.7,   // créativité (0.1 précis → 1.0 créatif)
  "top_p":        0.9,   // nucleus sampling
  "num_ctx":      8192,  // taille contexte (tokens)
  "num_predict":  512,   // longueur max réponse
  "preset":       "ÉQUILIBRÉ"  // RAPIDE | ÉQUILIBRÉ | QUALITÉ
}
// lancement & arrêt
# Installer les modèles Ollama avant de démarrer
ollama pull [MODEL_NAME]
ollama list   # vérifier les modèles disponibles

# Lancer JARVIS
cd scripts/
python jarvis.py
# → Serveur Flask démarré sur http://localhost:5000
# → Ouvrir le navigateur sur http://localhost:5000

# Arrêt propre (Windows)
# stop_jarvis.bat  ou  Ctrl+C dans le terminal

# Vérifier que le port est libre avant relance
netstat -ano | findstr :5000
// intégration SOC — configuration côté dashboard
# Dans le SOC Dashboard (monitoring-index.html)
# Renseigner l'URL JARVIS dans les paramètres du dashboard :
JARVIS_URL = "http://[JARVIS_HOST]:5000"

# Routes exposées par JARVIS pour le SOC :
GET  /api/gpu              → stats GPU temps réel
POST /api/chat             → analyse LLM narrative
GET  /api/tts              → lecture vocale alerte
GET  /api/security         → journal garde-fou LLM
POST /api/soc/ban-ip       → ban via CrowdSec
POST /api/soc/unban-ip     → lever un ban
POST /api/soc/restart-service → redémarrer un service

# JARVIS est optionnel — le SOC fonctionne sans lui