Mise à jour rapide

This commit is contained in:
Ladebeze66 2025-03-24 22:19:57 +01:00
parent 95c2406c39
commit 602a9055e2
9 changed files with 760 additions and 99 deletions

View File

@ -1,6 +1,6 @@
{ {
"collapse-filter": false, "collapse-filter": false,
"search": "", "search": "path:\"Serveur perso\" ",
"showTags": false, "showTags": false,
"showAttachments": false, "showAttachments": false,
"hideUnresolved": false, "hideUnresolved": false,
@ -60,6 +60,6 @@
"repelStrength": 10, "repelStrength": 10,
"linkStrength": 1, "linkStrength": 1,
"linkDistance": 250, "linkDistance": 250,
"scale": 0.5087618855792638, "scale": 1.4019828977761164,
"close": true "close": true
} }

View File

@ -4,38 +4,367 @@
"type": "split", "type": "split",
"children": [ "children": [
{ {
"id": "d991961c29ad106d", "id": "c2f4a1753293419f",
"type": "tabs", "type": "tabs",
"children": [ "children": [
{ {
"id": "8cd31f588ec21296", "id": "68491419da144553",
"type": "leaf", "type": "leaf",
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "command_list/Ollama commands.md", "file": "Obsidian/Ouvrir un terminal dans Obsidian.md",
"mode": "source", "mode": "preview",
"source": false "source": false
}, },
"icon": "lucide-file", "icon": "lucide-file",
"title": "Ollama commands" "title": "Ouvrir un terminal dans Obsidian"
} }
}, },
{ {
"id": "97ca7aff179659c4", "id": "6190bc947aeac61d",
"type": "leaf", "type": "leaf",
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "webdev/ROBO_MAT_Code_WLangage_Organise.md", "file": "ollama/guide_ollama_complet.md",
"mode": "source", "mode": "source",
"source": false "source": false
}, },
"icon": "lucide-file", "icon": "lucide-file",
"title": "ROBO_MAT_Code_WLangage_Organise" "title": "guide_ollama_complet"
}
},
{
"id": "4a79ae9b5cf40685",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Infrastructure Optimisée d'IA Locale.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "Infrastructure Optimisée d'IA Locale"
}
},
{
"id": "c732e844eb2b7094",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Infrastructure Optimisée d'IA Locale (version 2).md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Infrastructure Optimisée d'IA Locale (version 2)"
}
},
{
"id": "c425e145aee8cd6a",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Agent LLM Classes recherches 1.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "Agent LLM Classes recherches 1"
}
},
{
"id": "9f01b54131d8ad11",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Agent LLM Classes recherches 1.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Agent LLM Classes recherches 1"
}
},
{
"id": "b9670384c5347fe5",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/LLM Obsidian.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "LLM Obsidian"
}
},
{
"id": "3d7bf6b1be159bbe",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/LLM Cursor.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "LLM Cursor"
}
},
{
"id": "93feebe5d77bd0dc",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "ollama/Plan d'apprentissage détaillé sur Ollama.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "Plan d'apprentissage détaillé sur Ollama"
}
},
{
"id": "aab7b92f101ead65",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "inbox/StramDeck config.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "StramDeck config"
}
},
{
"id": "bf4f5ca51a0e0dd8",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Optimisation bios serveur.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Optimisation bios serveur"
}
},
{
"id": "2bc8a1b7fd6d9af5",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Infrastructure Optimisée d'IA Locale.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Infrastructure Optimisée d'IA Locale"
}
},
{
"id": "a152b360c324fb6f",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/LLM Cursor version2.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "LLM Cursor version2"
}
},
{
"id": "1da03f7485bb0fef",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Recherche modèles.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Recherche modèles"
}
},
{
"id": "a3ac048cd068ef21",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "inbox/Installation LLM +++.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "Installation LLM +++"
}
},
{
"id": "15f320992faf0688",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Jour 5 notes support traitement ticket dev.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Jour 5 notes support traitement ticket dev"
}
},
{
"id": "b3459535494873e5",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Obsidian/Obsidian CSS.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "Obsidian CSS"
}
},
{
"id": "72aa54670d29b111",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "inbox/prompt.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "prompt"
}
},
{
"id": "0e580d10b27a161e",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "inbox/prompt.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "prompt"
}
},
{
"id": "5afdc6cb3fe20644",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Préversion IA locales personnelle.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "Préversion IA locales personnelle"
}
},
{
"id": "4e69fedfd0d21df9",
"type": "leaf",
"state": {
"type": "graph",
"state": {},
"icon": "lucide-git-fork",
"title": "Vue graphique"
}
},
{
"id": "48842f66b7e7e365",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Obsidian/Liens dans obsidian.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Liens dans obsidian"
}
},
{
"id": "64922fb286281777",
"type": "leaf",
"state": {
"type": "graph",
"state": {},
"icon": "lucide-git-fork",
"title": "Vue graphique"
}
},
{
"id": "4102dd91ee7179ea",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "inbox/Piste d'améliorations du projet IA locale.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Piste d'améliorations du projet IA locale"
}
},
{
"id": "ff79cd1085f74b83",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Serveur perso/Création de classes agents pour LLM locaux avec Cursor et Ollama.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Création de classes agents pour LLM locaux avec Cursor et Ollama"
}
},
{
"id": "6d3c8a826a68010d",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Obsidian/Ouvrir un terminal dans Obsidian.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Ouvrir un terminal dans Obsidian"
} }
} }
] ],
"currentTab": 14
} }
], ],
"direction": "vertical" "direction": "vertical"
@ -92,7 +421,7 @@
} }
], ],
"direction": "horizontal", "direction": "horizontal",
"width": 300 "width": 200
}, },
"right": { "right": {
"id": "ad0ed0087b43302d", "id": "ad0ed0087b43302d",
@ -168,8 +497,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -178,8 +507,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -188,8 +517,8 @@
"state": { "state": {
"type": "side-panel-control-view", "type": "side-panel-control-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "viewIcon",
"title": "Le module complémentaire n'est plus actif." "title": "Markdown-Autocomplete"
} }
}, },
{ {
@ -198,8 +527,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -208,8 +537,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -218,8 +547,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -228,8 +557,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -238,8 +567,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -248,8 +577,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -258,8 +587,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -268,8 +597,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -278,8 +607,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -288,8 +617,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -298,8 +627,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -308,8 +637,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -318,8 +647,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -328,8 +657,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -338,8 +667,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -348,8 +677,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
}, },
{ {
@ -358,8 +687,8 @@
"state": { "state": {
"type": "SC-custom-variables-view", "type": "SC-custom-variables-view",
"state": {}, "state": {},
"icon": "lucide-file", "icon": "code-glyph",
"title": "Le module complémentaire n'est plus actif." "title": "Shell commands: Custom variables"
} }
} }
], ],
@ -373,55 +702,56 @@
"left-ribbon": { "left-ribbon": {
"hiddenItems": { "hiddenItems": {
"workspaces:Gérer les espaces de travail": false, "workspaces:Gérer les espaces de travail": false,
"table-editor-obsidian:Advanced Tables Toolbar": false,
"obsidian-markdown-formatting-assistant-plugin:Open Markdown Formatting Assistant": false,
"switcher:Ouvrir le sélecteur rapide": false, "switcher:Ouvrir le sélecteur rapide": false,
"graph:Ouvrir la vue graphique": false, "graph:Ouvrir la vue graphique": false,
"canvas:Créer une nouvelle toile": false, "canvas:Créer une nouvelle toile": false,
"daily-notes:Ouvrir la note quotidienne": false, "daily-notes:Ouvrir la note quotidienne": false,
"templates:Insérer le modèle": false, "templates:Insérer le modèle": false,
"command-palette:Ouvrir la palette de commandes": false, "command-palette:Ouvrir la palette de commandes": false,
"table-editor-obsidian:Advanced Tables Toolbar": false,
"obsidian-markdown-formatting-assistant-plugin:Open Markdown Formatting Assistant": false,
"obsidian-shellcommands:Shell commands: Custom variables": false, "obsidian-shellcommands:Shell commands: Custom variables": false,
"templater-obsidian:Templater": false "templater-obsidian:Templater": false
} }
}, },
"active": "8cd31f588ec21296", "active": "a3ac048cd068ef21",
"lastOpenFiles": [ "lastOpenFiles": [
"webdev/ROBO_MAT_Analyse_clsMistral.md", "Serveur perso/Recherche modèles.md",
"webdev/ROBO_MAT_Analyse_clsOllama.md", "inbox/Installation LLM +++.md",
"webdev/Non confirmé 702528.crdownload", "Serveur perso/Installation LLM dans Cursor.md",
"webdev/ROBO_MAT_Analyse_Fonctionnelle.md", "Serveur perso/LLM Cursor.md",
"webdev/Rappel de certaines notions WLangage et Classes.md", "Serveur perso/LLM Cursor version2.md",
"inbox/Non confirmé 367059.crdownload", "command_list/Ollama commands.md",
"webdev/ROBO_MAT_Code_WLangage_Organise.md", "Serveur perso/Infrastructure Optimisée d'IA Locale.md",
"Serveur perso/Création de classes agents pour LLM locaux avec Cursor et Ollama.md",
"Serveur perso/automatiser-lancement-serveur-windows.md",
"Serveur perso/Agent LLM recherches 2.md",
"Serveur perso/Agent LLM Classes recherches 1.md",
"ollama/Plan d'apprentissage détaillé sur Ollama.md",
"ollama/guide_ollama_complet.md",
"command_list/Commandes Nvidia.md",
"Serveur perso/LLM Obsidian.md",
"Serveur perso/Préversion IA locales personnelle.md",
"Serveur perso/Infrastructure Optimisée d'IA Locale (version 2).md",
"Serveur perso/Piste d'améliorations du projet IA locale.md",
"inbox/wild.md",
"webdev/PJ/wlangage_class_code.json", "webdev/PJ/wlangage_class_code.json",
"webdev/Analyse_ROBO_MAT_Complete.md", "webdev/PJ/structure_projet_robo_mat.txt",
"inbox/prompt.md",
"inbox/Odoo.md",
"inbox/Notes RAGFLOW.md",
"inbox/Notes projet LLM.md",
"inbox/Node.js.md",
"inbox/Fichier type json récupération odoo.md",
"inbox/Arborescence du programme.md",
"command_list/Git commands.md",
"inbox/StramDeck config.md",
"inbox/Scripts requêtes Odoo.md",
"inbox/ROBO_MAT_Code_WLangage_Organise.json",
"inbox/Non confirmé 873082.crdownload",
"inbox/ROBO_MAT_Analyse_clsDeepl.md",
"inbox/Non confirmé 727828.crdownload",
"inbox/version épuée.md",
"inbox/Sans titre.md",
"webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md",
"inbox/Non confirmé 465885.crdownload",
"webdev/structure_projet_robo_mat.md", "webdev/structure_projet_robo_mat.md",
"webdev/ROBO_MAT_Code_WLangage_Organise.md",
"webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md",
"webdev/Rappel de certaines notions WLangage et Classes.md",
"webdev/ROBO_MAT_Analyse_Fonctionnelle.md",
"webdev/PJ",
"webdev/Analyse_ROBO_MAT_Complete.md",
"webdev/Application webdev (1).md", "webdev/Application webdev (1).md",
"inbox/Non confirmé 948241.crdownload", "webdev",
"inbox/Non confirmé 34515.crdownload", "inbox/ROBO_MAT_Code_WLangage_Organise.json",
"inbox/Non confirmé 822614.crdownload", "Streamdeck",
"inbox/ROBO_MAT_Analyse_Adaptation.md", "command_list",
"webdev/00_Template_Analyse_ROBO_MAT.md", "Stage",
"webdev/01_WLangage_Récupération_Projet_WebDev.md", "ollama",
"Obsidian",
"captures/signature.png", "captures/signature.png",
"captures/Capture d'écran 2025-03-20 150304.png", "captures/Capture d'écran 2025-03-20 150304.png",
"captures/Capture d'écran 2025-03-20 150213.png", "captures/Capture d'écran 2025-03-20 150213.png",

View File

@ -149,5 +149,3 @@ print(code_agent.respond("def addition(a, b): return a + b"))
- Base solide pour agents orchestrables. - Base solide pour agents orchestrables.
--- ---
Souhaites-tu que je taide à créer un routeur ou une interface CLI/Streamlit pour tester ça en live ?

View File

@ -91,15 +91,15 @@ ollama stop <modèle>
## Tableau des commandes Nvidia détaillées ## Tableau des commandes Nvidia détaillées
|Commande|Description| | Commande | Description |
|---|---| | ----------------------- | ----------------------------------------------- |
|`nvidia-smi`|Affiche usage GPU actuel, mémoire, température.| | `nvidia-smi` | Affiche usage GPU actuel, mémoire, température. |
|`nvidia-smi -l 1`|Rafraîchissement toutes les secondes| | `nvidia-smi -l 1` | Rafraîchissement toutes les secondes |
|`nvidia-smi -q`|Rapport complet GPU| | `nvidia-smi -q` | Rapport complet GPU |
|`nvidia-smi topo -m`|Topologie GPU (multi-GPU)| | `nvidia-smi topo -m` | Topologie GPU (multi-GPU) |
|`nvcc --version`|Version CUDA installée| | `nvcc --version` | Version CUDA installée |
|`watch -n 1 nvidia-smi`|Suivi temps réel GPU (Linux/WSL)| | `watch -n 1 nvidia-smi` | Suivi temps réel GPU (Linux/WSL) |
|`nvitop`|Surveillance interactive temps réel (GPU)| | `nvitop` | Surveillance interactive temps réel (GPU) |
--- ---

View File

@ -0,0 +1,150 @@
# 🎯 Tutoriel : Intégrer `codellama:13b-python` dans Cursor avec la Sidebar + Cline
Ce guide complet texplique comment :
- Intégrer le modèle **codellama:13b-python** local (via **Ollama**) dans Cursor
- Lutiliser dans la **sidebar des agents + Ask** de Cursor
- Configurer **Cline** pour tirer le meilleur de ton modèle local
---
## ✅ Prérequis
- ✅ Ollama est installé et configuré
- ✅ Modèle téléchargé : `ollama pull codellama:13b-python`
- ✅ Variable `OLLAMA_MODELS` correctement configurée si besoin
- ✅ Cursor est installé ([https://cursor.so](https://cursor.so/))
---
## 🧱 Étape 1 : Vérifier que le modèle fonctionne
Dans ton terminal :
```bash
ollama run codellama:13b-python
```
> Tu dois pouvoir chatter avec le modèle en ligne de commande.
---
## 🛠️ Étape 2 : Configurer `cursor-agent.json`
1. À la racine de ton projet, crée un fichier :
```bash
cursor-agent.json
```
2. Mets-y ceci :
```json
{
"name": "CodeLlama Local",
"entry": "main.py",
"llm": {
"provider": "custom",
"completion_url": "http://localhost:11434/api/generate",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"input_key": "prompt",
"output_key": "response"
}
}
```
---
## 🧠 Étape 3 : Créer un script Python minimal `main.py`
```python
import sys
import json
import requests
prompt = sys.stdin.read().strip()
payload = {
"model": "codellama:13b-python",
"prompt": prompt,
"stream": False
}
res = requests.post("http://localhost:11434/api/generate", json=payload)
print(json.dumps({"response": res.json().get("response", "")}))
```
✅ Ce script lit un prompt depuis Cursor, interroge Ollama, et retourne la réponse.
---
## 🧪 Étape 4 : Vérifier que Cursor reconnaît le modèle
- Ouvre Cursor
- Clique sur la **sidebar des agents (Ask)** à gauche
- Tu devrais voir **CodeLlama Local** dans la liste
- Clique dessus et tape une commande (ex : `Peux-tu générer une fonction en Python ?`)
✅ Si tout est bien configuré, tu verras la réponse de `codellama` safficher.
---
## 💬 Étape 5 : Utiliser le modèle avec **Cline**
### 🔹 Quest-ce que Cline ?
Cline est la barre latérale à droite de Cursor qui te permet de :
- Sélectionner un modèle
- Voir lhistorique des prompts
- Travailler sur une sélection de code
### 📌 Utilisation :
1. Sélectionne du code dans un fichier Python
2. Tape `//` pour activer le prompt intégré
3. Cursor ouvrira automatiquement **Cline**
4. Clique sur la flèche déroulante à côté de "Model" et choisis **CodeLlama Local**
### ✅ Astuces :
- Tu peux taper des prompts personnalisés du style :
- "Optimise ce code."
- "Corrige les erreurs."
- "Ajoute un docstring."
- Les suggestions sappliqueront directement sur le code sélectionné
---
## 🔧 Étape 6 : Personnaliser encore plus avec des agents dynamiques
Tu peux relier `main.py` à ta propre classe Python dagent (voir tutoriels précédents) pour :
- Définir un rôle spécifique à chaque agent
- Créer une interface CLI
- Injecter des prompts système
---
## 🧹 Étape 7 : Résolution de problèmes
- Si `CodeLlama Local` napparaît pas : redémarre Cursor ou vérifie que tu es dans le bon dossier
- Si rien ne s'affiche : assure-toi que le service Ollama tourne (tester avec `ollama run`)
- Pour voir les erreurs de Cursor : `Ctrl+Shift+I` > Console
---
## ✅ Tu es prêt !
Tu peux maintenant :
- Utiliser ton modèle local dans la **sidebar Ask** de Cursor
- Poser des questions directement dans le **cline** à droite
- Interagir avec `codellama:13b-python` sans dépendre de lAPI OpenAI ou dinternet
Souhaites-tu maintenant que je te génère des variantes avec rôles dynamiques par agent ou une intégration CLI/Streamlit ?

View File

@ -15,6 +15,7 @@
- Avoir installé **Cursor** : [https://cursor.so](https://cursor.so/) - Avoir installé **Cursor** : [https://cursor.so](https://cursor.so/)
- Avoir installé **Ollama** : [[https://ollama.com](https://ollama.com/)) - Avoir installé **Ollama** : [[https://ollama.com](https://ollama.com/))
- Avoir Python 3.10+ installé - Avoir Python 3.10+ installé
[[Installation LLM dans Cursor]]
### Installer un modèle avec Ollama : ### Installer un modèle avec Ollama :

View File

@ -122,4 +122,3 @@ PM2 permet de :
--- ---
> ✉️ Besoin : export `.ps1` prêt à lemploi ou `.xml` du planificateur ? Demande-moi !

View File

@ -0,0 +1,11 @@
## Tableau des commandes Nvidia détaillées
| Commande | Description |
| ----------------------- | ----------------------------------------------- |
| `nvidia-smi` | Affiche usage GPU actuel, mémoire, température. |
| `nvidia-smi -l 1` | Rafraîchissement toutes les secondes |
| `nvidia-smi -q` | Rapport complet GPU |
| `nvidia-smi topo -m` | Topologie GPU (multi-GPU) |
| `nvcc --version` | Version CUDA installée |
| `watch -n 1 nvidia-smi` | Suivi temps réel GPU (Linux/WSL) |
| `nvitop` | Surveillance interactive temps réel (GPU) |

View File

@ -0,0 +1,172 @@
---
# 🎯 Tutoriel : Intégrer `codellama:13b-python` dans Cursor avec Cline — Version Optimisée et Ergonomique
Ce guide te montre **la méthode la plus simple et efficace** pour exploiter tes modèles locaux `codellama:13b-python` (pour Cursor) et `llama2:13b` (pour Obsidian) via **Cline**, tout en te donnant la capacité de gérer plusieurs LLM, de modifier dynamiquement leurs paramètres, et de créer plusieurs agents spécialisés.
---
## ✅ Objectif
- Utiliser tes modèles locaux via **Cline**, l'interface latérale intelligente de Cursor
- Passer rapidement dun modèle à un autre (`codellama` pour Cursor, `llama2:13b` pour Obsidian)
- Gérer facilement le contexte, les rôles dynamiques et les paramètres personnalisés de chaque modèle
- Centraliser les fichiers de configuration et les réutiliser dans tous tes projets Cursor ou Obsidian
---
## 🧱 Étape 1 : Préparer les modèles avec Ollama
### Télécharger les modèles que tu veux utiliser :
```bash
ollama pull codellama:13b-python # Pour Cursor (code)
ollama pull llama2:13b # Pour Obsidian (généraliste structuré)
```
✅ Vérifie quils sont bien installés :
```bash
ollama list
```
---
## 📁 Étape 2 : Organisation centrale des fichiers
Plutôt que de recopier à chaque fois, crée un dossier centralisé :
```
~/cursor-llm-config/
├── cursor-agent.json
├── main.py
├── config.json # Gère les paramètres dynamiques des modèles
├── agents/
│ ├── optimizer.py
│ ├── refactor.py
│ └── docstringer.py
```
> 💡 Ce dossier peut être placé dans un emplacement accessible depuis WSL ET Windows si tu utilises Cursor sous Windows (ex: `/mnt/c/Users/tonprofil/llm-config`) pour unifier l'accès.
---
## ⚙️ Étape 3 : Fichier `cursor-agent.json`
```json
{
"name": "LLM Local Agent",
"entry": "main.py",
"llm": {
"provider": "custom",
"completion_url": "http://localhost:11434/api/generate",
"method": "POST",
"headers": { "Content-Type": "application/json" },
"input_key": "prompt",
"output_key": "response"
}
}
```
---
## 🧠 Étape 4 : Script `main.py` configurable
```python
import sys
import json
import requests
import os
with open("config.json", "r") as f:
config = json.load(f)
model = config.get("model", "codellama:13b-python")
prompt = sys.stdin.read().strip()
payload = {
"model": model,
"prompt": prompt,
"temperature": config.get("temperature", 0.7),
"top_p": config.get("top_p", 0.9),
"num_predict": config.get("num_predict", 2048),
"stream": False
}
res = requests.post("http://localhost:11434/api/generate", json=payload)
print(json.dumps({"response": res.json().get("response", "")}))
```
---
## 🧩 Étape 5 : Fichier `config.json` pour personnaliser les paramètres
```json
{
"model": "codellama:13b-python",
"temperature": 0.7,
"top_p": 0.9,
"num_predict": 2048
}
```
> 🔄 Pour Obsidian, change simplement `"model"` en `"llama2:13b"`.
---
## 🧬 Étape 6 : Utiliser Cline efficacement
1. Ouvre Cursor et sélectionne du code
2. Tape `//` ou clic droit > "Ask..."
3. Dans la barre Cline :
- Sélectionne le modèle : `LLM Local Agent`
- Ajoute un prompt (ex : "Optimise cette fonction")
Tu peux combiner prompt utilisateur + système pour obtenir des réponses sur mesure.
---
## 🧠 Étape 7 : Créer plusieurs agents spécialisés (optionnel mais recommandé)
Crée un dossier `agents/` avec des fichiers comme :
- `optimizer.py` → Optimisation de fonctions
- `refactor.py` → Refactorisation
- `docstringer.py` → Génération de docstrings
Chacun peut être appelé depuis un wrapper CLI ou une extension Cursor avancée.
---
## 💡 Étape 8 : Configuration pour Obsidian
- Le modèle `llama2:13b` est recommandé pour ses capacités de résumé, classification, mise en forme, et structuration de notes.
- Tu peux utiliser le même `main.py` et `config.json`, en modifiant simplement le modèle.
- Pour automatiser avec Obsidian (via un plugin ou script externe), tu peux lancer une requête vers `http://localhost:11434/api/generate` avec un prompt construit dynamiquement depuis le contenu dune note Markdown.
---
## 🚀 Astuce : Script CLI de sélection
Crée un script CLI qui te permet de modifier `config.json` à la volée :
```bash
python switch_model.py --model llama2:13b --temperature 0.6
```
Et dans `switch_model.py`, édite dynamiquement le fichier `config.json`.
---
## ✅ Résumé
|Étape|Action clé|
|---|---|
|1. Ollama|Télécharger `codellama:13b-python` + `llama2:13b`|
|2. Structure|Centraliser `main.py`, `config.json`, `cursor-agent.json`|
|3. Cline|Utiliser ton modèle local depuis l'interface|
|4. Paramètres|Modifier facilement température, top_p, nombre de tokens|
|5. Agents|Créer des agents spécialisés pour chaque type de tâche|
|6. Obsidian|Utiliser `llama2:13b` pour améliorer, structurer et relier les notes|
---