mirror of
https://github.com/Ladebeze66/coffreobsidian.git
synced 2025-12-16 23:17:43 +01:00
153 lines
3.7 KiB
Markdown
153 lines
3.7 KiB
Markdown
# Infrastructure Optimisée d'IA Locale
|
|
|
|
---
|
|
|
|
## PC Principal (Windows 11 Pro)
|
|
|
|
### Objectifs :
|
|
|
|
- Intégrer 2 modèles LLM locaux 13B (Obsidian et Cursor).
|
|
- Installer Ollama sur Windows (WSL2 recommandé).
|
|
- Base de données vectorielle (RAG) pour stocker : notes, code, site web.
|
|
- Pipeline via Node.js.
|
|
|
|
### 1. Installation et gestion Ollama (WSL2 recommandé)
|
|
|
|
WSL2 est recommandé pour une meilleure performance avec Ollama et l'utilisation directe du GPU Nvidia (RTX 4090).
|
|
|
|
**Commandes essentielles :**
|
|
|
|
```bash
|
|
# Installer WSL2
|
|
wsl --install
|
|
|
|
# Installer Ubuntu (recommandé)
|
|
wsl --install -d Ubuntu
|
|
|
|
# Installation Ollama sous WSL2
|
|
curl -fsSL https://ollama.com/install.sh | sh
|
|
|
|
# Télécharger et exécuter un modèle LLM
|
|
ollama pull mistral
|
|
ollama run mistral
|
|
|
|
# Vérification GPU (Nvidia)
|
|
nvidia-smi
|
|
```
|
|
|
|
### 2. Sélection des Modèles LLM
|
|
|
|
- **Obsidian** : Modèle adapté à l'organisation et à la rédaction (Ex : Mistral 13B).
|
|
- **Cursor** : Modèle spécialisé en programmation (Ex : CodeLlama 13B Python).
|
|
|
|
**Exemples commandes Ollama :**
|
|
|
|
```bash
|
|
ollama pull mistral:13b-instruct
|
|
ollama pull codellama:13b-python
|
|
```
|
|
|
|
### 3. Organisation Disque et Installation
|
|
|
|
**Architecture de stockage recommandée :**
|
|
|
|
- **Disque principal (Crucial T700 - 2 To)** : Windows 11, logiciels principaux, Ollama, environnement WSL.
|
|
- **Disques Crucial P3 (2 x 4 To)** :
|
|
- P3 (1) : Modèles LLM et base vectorielle (RAG).
|
|
- P3 (2) : Stockage des données (notes, code, contenus divers).
|
|
- **SSD MX500 SATA** : Sauvegardes automatiques et fichiers temporaires.
|
|
|
|
### 4. Base de Données Vectorielle (RAG)
|
|
|
|
Utilisation de [ChromaDB](https://github.com/chroma-core/chroma) pour la simplicité et la performance avec Node.js pour pipelines.
|
|
|
|
```bash
|
|
# Installation Node.js (Windows / WSL)
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
|
sudo apt install -y nodejs
|
|
|
|
# Installation ChromaDB
|
|
pip install chromadb
|
|
```
|
|
|
|
### 5. Fine-tuning (LoRA)
|
|
|
|
- Utiliser [QLoRA](https://github.com/artidoro/qlora) pour fine-tuning efficace sur GPU.
|
|
|
|
```bash
|
|
pip install peft
|
|
pip install transformers datasets accelerate bitsandbytes
|
|
```
|
|
|
|
### 6. Gestion GPU et IA (Pause/Reprise)
|
|
|
|
- Facilité par les commandes Ollama.
|
|
|
|
```bash
|
|
ollama stop <modèle>
|
|
ollama start <modèle>
|
|
```
|
|
|
|
---
|
|
|
|
## Serveur Windows Server 2025
|
|
|
|
### Objectifs :
|
|
|
|
- Héberger site (Next.js, Strapi).
|
|
- Chatbot (FastAPI + Mistral 7B).
|
|
- RAG centralisé.
|
|
|
|
### Architecture
|
|
|
|
- **Disque NVMe Gen3** : OS, IIS, Next.js, Strapi.
|
|
- **SSD 240 Go SATA** : Applications légères, FastAPI.
|
|
- **HDD RAID1** : Données site web (images, médias).
|
|
- **HDD 8To / 3To** : Sauvegardes, archives.
|
|
|
|
### Installation et Configuration
|
|
|
|
- **IIS pour Next.js et Strapi :**
|
|
|
|
- Hébergement via reverse-proxy IIS vers Node.js.
|
|
- **FastAPI et Chatbot :**
|
|
|
|
```bash
|
|
pip install fastapi uvicorn ollama
|
|
```
|
|
|
|
- **Modèle Ollama (Mistral 7B)** :
|
|
|
|
```bash
|
|
ollama pull mistral:7b
|
|
```
|
|
|
|
|
|
### Pipeline RAG centralisé
|
|
|
|
- Synchronisation automatique via scripts Node.js et API ChromaDB.
|
|
|
|
```bash
|
|
npm init -y
|
|
npm install axios express
|
|
```
|
|
|
|
---
|
|
|
|
## Résumé des commandes essentielles :
|
|
|
|
|Tâche|Commande essentielle|
|
|
|---|---|
|
|
|Installer WSL2|`wsl --install`|
|
|
|Installation Ollama|`curl -fsSL [https://ollama.com/install.sh](https://ollama.com/install.sh)|
|
|
|Gestion Ollama (modèles)|`ollama pull <modèle>` / `ollama run <modèle>`|
|
|
|Vérifier GPU Nvidia|`nvidia-smi`|
|
|
|Installer ChromaDB|`pip install chromadb`|
|
|
|Installer FastAPI|`pip install fastapi uvicorn`|
|
|
|Installation Node.js|`curl -fsSL [https://deb.nodesource.com/setup_20.x](https://deb.nodesource.com/setup_20.x)|
|
|
|Installer QLoRA|`pip install peft transformers datasets accelerate bitsandbytes`|
|
|
|
|
---
|
|
|
|
[[Recherche modèles]]
|
|
[[Plan d'apprentissage détaillé sur Ollama]] |