<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Mon, 18 May 2026 12:33:24 +0200 -->
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Wiki]]></title>
		<atom:link href="https://www.mageialinux-online.org/syndication/rss/wiki/55" rel="self" type="application/rss+xml"/>
		<link>https://www.mageialinux-online.org</link>
		<description><![CDATA[Derniers articles de la catégorie Intelligence Artificielle]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>fr</language>
		<generator>PHPBoost</generator>
		
            <item>
                <title><![CDATA[L'IA générative avec Ollama]]></title>
                <link>https://www.mageialinux-online.org/wiki/l-ia-generative-avec-ollama</link>
                <guid>https://www.mageialinux-online.org/wiki/l-ia-generative-avec-ollama</guid>
                <description><![CDATA[<span class="message-helper bgc notice">En cours de rédaction</span><br />
<br />
<span class="message-helper bgc warning">Tutorial réservé aux utilisateurs avancés.</span><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-introduction">Introduction</h2><br />

<br />
L'utilisation de modèles d'intelligence artificielle générative open source est en effet une option accessible pour de nombreuses applications personnelles telles que la rédaction de résumés ou la traduction de textes. Bien que ces modèles ne soient pas aussi avancés que ceux développés par des organisations comme OpenAI ou Anthropic, ils offrent néanmoins une performance remarquable pour les utilisateurs individuels. Il est important de noter que, malgré leur utilité, ces modèles peuvent parfois générer des informations incorrectes ou des <a class="offload" href="https://fr.wikipedia.org/wiki/Hallucination_(intelligence_artificielle)">hallucinations</a>, où l'IA produit des données qui ne sont pas ancrées dans la réalité. C'est pourquoi il est crucial de toujours vérifier et critiquer les résultats fournis par ces IA, surtout lorsqu'ils sont utilisés dans des contextes où la précision est essentielle.<br />
<br />
Les modèles de traitement du langage naturel, ou NLP, sont effectivement des outils puissants dans le domaine de l'IA générative. La taille des modèles open source varie généralement entre 4 et 40 Go, ce qui nécessite des systèmes informatiques avec une grande quantité de RAM pour les charger efficacement en mémoire. En plus de la RAM, un processeur (CPU) et une unité de traitement graphique (GPU) performants sont cruciaux pour optimiser l'expérience utilisateur. Il est vrai que plus un modèle est grand, plus il peut fournir des réponses précises et détaillées. Cependant, cela peut également entraîner une augmentation du temps de réponse. Trouver le bon équilibre entre la taille du modèle et les capacités de votre équipement est essentiel pour tirer le meilleur parti de ces technologies avancées.<br />
<br />
L'installation d'outils comme  <a class="offload" href="https://ollama.com/">ollama</a>  peut grandement simplifier le processus de gestion des modèles LLM (Large Language Models), en automatisant le téléchargement, l'installation et les mises à jour. Cependant, l'ergonomie n'étant pas toujours au rendez-vous, l'intégration d'une interface utilisateur web, telle que o<a class="offload" href="https://docs.openwebui.com/">openwebui</a> peut améliorer l'expérience utilisateur. Ces interfaces web offrent une ressemblance avec celles utilisées pour interagir avec des assistants virtuels, rendant ainsi l'utilisation des modèles LLM plus intuitive. Avec une interface bien conçue, les utilisateurs peuvent facilement naviguer entre les différents modèles, les utiliser, les mettre à jour ou les personnaliser selon leurs besoins spécifiques. Cela démocratise l'accès aux technologies de pointe en intelligence artificielle, permettant à un plus grand nombre de personnes de tirer parti de ces outils puissants pour diverses applications.<br />
<br />
Ce tutorial a été réalisé avec une machine PC comportant 32 Gb de RAM et une carte Nvidia RTX 3060 sous Mageia 9. Les drivers propriétaires de la carte nvidia ont été installés ainsi que l'extension opencl.<br />
<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-pre-requis-sur-une-environnement-nvidia">Pré-Requis sur une environnement nvidia</h2><br />

Le driver propriétaire nvidia doit être installé préalablement. CUDA, même s'il n'est pas obligatoire, permettra d'obtenir des temps de réponses bien meilleures.<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">urpmi nvidia-current-cuda-opencl</pre></pre></div></div><br />
<br />
Pour vérifier le bon fonctionnement de votre solution, lancer la commande nvidia-smi depuis une konsole root<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>raptor ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># nvidia-smi</span>
Sat Sep  <span style="color: #000000;">7</span> <span style="color: #000000;">10</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">44</span> <span style="color: #000000;">2024</span>       
+-----------------------------------------------------------------------------------------+
<span style="color: #000000; font-weight: bold;">|</span> NVIDIA-SMI <span style="color: #000000;">550.100</span>                Driver Version: <span style="color: #000000;">550.100</span>        CUDA Version: <span style="color: #000000;">12.4</span>     <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>-----------------------------------------+------------------------+----------------------+
<span style="color: #000000; font-weight: bold;">|</span> GPU  Name                 Persistence-M <span style="color: #000000; font-weight: bold;">|</span> Bus-Id          Disp.A <span style="color: #000000; font-weight: bold;">|</span> Volatile Uncorr. ECC <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> Fan  Temp   Perf          Pwr:Usage<span style="color: #000000; font-weight: bold;">/</span>Cap <span style="color: #000000; font-weight: bold;">|</span>           Memory-Usage <span style="color: #000000; font-weight: bold;">|</span> GPU-Util  Compute M. <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>                                         <span style="color: #000000; font-weight: bold;">|</span>                        <span style="color: #000000; font-weight: bold;">|</span>               MIG M. <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>=========================================+========================+======================<span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #000000;">0</span>  NVIDIA GeForce RTX <span style="color: #000000;">3060</span>        Off <span style="color: #000000; font-weight: bold;">|</span>   00000000:01:<span style="color: #000000;">00.0</span>  On <span style="color: #000000; font-weight: bold;">|</span>                  N<span style="color: #000000; font-weight: bold;">/</span>A <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>  <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span>   48C    P8             19W <span style="color: #000000; font-weight: bold;">/</span>  170W <span style="color: #000000; font-weight: bold;">|</span>     666MiB <span style="color: #000000; font-weight: bold;">/</span>  12288MiB <span style="color: #000000; font-weight: bold;">|</span>      <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">%</span>      Default <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>                                         <span style="color: #000000; font-weight: bold;">|</span>                        <span style="color: #000000; font-weight: bold;">|</span>                  N<span style="color: #000000; font-weight: bold;">/</span>A <span style="color: #000000; font-weight: bold;">|</span>
+-----------------------------------------+------------------------+----------------------+
&nbsp;
+-----------------------------------------------------------------------------------------+
<span style="color: #000000; font-weight: bold;">|</span> Processes:                                                                              <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>  GPU   GI   CI        PID   Type   Process name                              GPU Memory <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>        ID   ID                                                               Usage      <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>=========================================================================================<span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #000000;">0</span>   N<span style="color: #000000; font-weight: bold;">/</span>A  N<span style="color: #000000; font-weight: bold;">/</span>A      <span style="color: #000000;">1296</span>      G   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>Xorg                             305MiB <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #000000;">0</span>   N<span style="color: #000000; font-weight: bold;">/</span>A  N<span style="color: #000000; font-weight: bold;">/</span>A      <span style="color: #000000;">3883</span>      G   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>kwalletd5                              2MiB <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #000000;">0</span>   N<span style="color: #000000; font-weight: bold;">/</span>A  N<span style="color: #000000; font-weight: bold;">/</span>A      <span style="color: #000000;">4131</span>      G   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ksmserver                              2MiB <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #000000;">0</span>   N<span style="color: #000000; font-weight: bold;">/</span>A  N<span style="color: #000000; font-weight: bold;">/</span>A      <span style="color: #000000;">4133</span>      G   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>kded5                                  2MiB <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #000000;">0</span>   N<span style="color: #000000; font-weight: bold;">/</span>A  N<span style="color: #000000; font-weight: bold;">/</span>A      <span style="color: #000000;">4135</span>      G   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>kwin_x11                              78MiB <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span>.....
<span style="color: #000000; font-weight: bold;">|</span>.........
<span style="color: #000000; font-weight: bold;">|</span>......
+-----------------------------------------------------------------------------------------+</pre></pre></div></div><br />
<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-pre-requis-sur-une-environnement-amd">Pré-Requis sur une environnement amd</h2><br />

Même si l'installation de rocm n'est pas obligatoire, il est conseillé sur un environnement disposant de cartes graphiques récentes pour tirer pleinement de la puissance de votre GPU et améliorer considérablement les temps de réponse.<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">rocm-amd-opencl</pre></pre></div></div><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-docker-et-de-pip">Installation de docker et de pip</h2><br />

<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">urpmi python3-pip docker docker-compose
systemctl <span style="color: #7a0874; font-weight: bold;">enable</span> docker.service
systemctl start docker.service</pre></pre></div></div><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-d-ollama">Installation d'ollama</h2><br />

<br />
<span class="message-helper bgc warning">Votre utilisateur doit pouvoir avoir les droits pour utiliser la commande sudo. Pour cela, il suffit d'ajouter dans le fichier /etc/sudoers la ligne<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">utilisateur ALL=(ALL)  ALL</pre></pre></div></div></span><br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">curl https:<span style="color: #000000; font-weight: bold;">//</span>ollama.ai<span style="color: #000000; font-weight: bold;">/</span>install.sh <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sh</span></pre></pre></div></div><br />
<br />
Puis démarrer le service en se connectant root<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
systemctl <span style="color: #7a0874; font-weight: bold;">enable</span> ollama.service
systemctl start ollama.service</pre></pre></div></div><br />
<br />
<h2 class="formatter-title">Installation de modèle localement</h2><br />
On décrit ici comment simplement télécharger et déployer un modèle LLM  sur votre machine. Attention, par principe, le chargement du modèle va s'opérer principalement au niveau de la mémoire de votre GPU et/ou de votre mémoire RAM. Il faut veiller à ne pas prendre des modèles qui auraient une taille démesuré au regard de la RAM/DRAM dont vous disposer.<br />
<br />
Téléchargement du modèle gemma2 9B - 9 milliards de paramètres- 5.5GB<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">ollama pull gemma2</pre></pre></div></div><br />
Téléchargement du modèle Mistral 7B - 7 milliards de paramètres 4.1GB<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">ollama pull mistral</pre></pre></div></div><br />
Téléchargement du modèle llama3.1 8B - 8 milliards de paramètres 4.7GB<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">ollama pull llama3.1</pre></pre></div></div><br />
Pour d'autres modèles voir le catalogue <a class="offload" href="https://ollama.com/library">https://ollama.com/library</a><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-configuration-adaptee-a-docker-du-firewall-shorewall">Configuration adaptée à docker du firewall shorewall</h2><br />

<span class="message-helper bgc warning">L'activation du firewall Shorewall est cruciale pour sécuriser les interfaces réseau exposées à Internet, telles que le Wi-Fi et l'Ethernet. Par défaut, la configuration de shorewall empêche le fonctionnement correct de docker </span><br />
<br />
Editer le fichier /etc/shorewall/interfaces et ajouter la ligne suivante :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">dock    docker0</pre></pre></div></div><br />
<br />
Editer le fichier /etc/shorewall/zones et ajouter la ligne suivante :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">dock    ipv4</pre></pre></div></div><br />
<br />
Editer le fichier /etc/shorewall/policy et ajouter les lignes pour avoir :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">do#
fw      net     ACCEPT
net     all     DROP    info
#Ajout Vouf
dock    fw      REJECT
dock    all     ACCEPT
fw      dock    ACCEPT
#Fin ajout
all     all     REJECT  info</pre></pre></div></div><br />
Editer le fichier /etc/shorewall/shorewall.conf et modifier la variable DOCKER=No à<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">DOCKER=yes</pre></pre></div></div><br />
Puis redémarrer shorewall<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">systemctl restart shorewall.service</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-openwebui-pour-interagir-avec-le-modele">Installation de openwebui pour interagir avec le modèle</h2><br />

Openwebui sera déployé et installé avec l'image docker proposé par l'équipe projet.<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">docker run <span style="color: #660033;">-d</span> <span style="color: #660033;">--network</span>=host <span style="color: #660033;">-v</span> open-webui:<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>backend<span style="color: #000000; font-weight: bold;">/</span>data <span style="color: #660033;">-e</span> <span style="color: #007800;">OLLAMA_BASE_URL</span>=http:<span style="color: #000000; font-weight: bold;">//</span>127.0.0.1:<span style="color: #000000;">11434</span> <span style="color: #660033;">--name</span> open-webui <span style="color: #660033;">--restart</span> always ghcr.io<span style="color: #000000; font-weight: bold;">/</span>open-webui<span style="color: #000000; font-weight: bold;">/</span>open-webui:main</pre></pre></div></div><br />
<br />
<ul class="formatter-ul">
    <li class="formatter-li">-v open-webui:/app/backend/data : Cela monte un volume nommé open-webui dans le répertoire /app/backend/data du conteneur.
    </li><li class="formatter-li">-d : Cette option signifie &#8220;détaché&#8221; et permet d&#8217;exécuter le conteneur en arrière-plan.
    </li><li class="formatter-li">--name open-webui : Cela attribue le nom &#8220;open-webui&#8221; au conteneur.
    </li><li class="formatter-li">--restart always : Cette option spécifie que le conteneur doit toujours redémarrer automatiquement en cas d&#8217;échec.
    </li><li class="formatter-li">ghcr.io/open-webui/open-webui:main : C&#8217;est l&#8217;image à partir de laquelle le conteneur sera créé
    </li><li class="formatter-li">--network=host  Indicateur permettant de résoudre les soucis de connexion entre le conteneur et le service ollama qui expose le modèle.
        </li><li class="formatter-li">OLLAMA_BASE_URL=http://127.0.0.1:11434 , url de communication avec le service ollama, peut être configuré au niveau de l'ihm openwebui<br />
</li></ul><br />
<br />
<br />
<br />
Se connecter ensuite à l'ihm à l'adresse <a class="offload" href="http://localhost:8080">http://localhost:8080</a><br />
La création d'un compte est à réaliser une première fois. Renseignez un email et un mot de passe. Ce compte est uniquement sur votre machine.<br />
On peut ensuite paramétrer le modèle utilisé soit au niveau de la partie administration pour tout les utilisateurs, soit au niveau du prompt.<br />
<br />
<p style="text-align: center;"><img src="https://www.mageialinux-online.org/upload/openwebui.png" alt="openwebui" /></p><br />
<br />
<h2 class="formatter-title">Annexes</h2><br />
<a class="offload" href="https://docs.docker.com/get-started/docker_cheatsheet.pdf">Rappel des principales commandes docker</a><br />
<a class="offload" href="https://huggingface.co/">Annuaire communautaire de référence des modèles open source<br />
</a><br />
<em><span style="font-size: 10px;"><br />
Rédigé par le vouf le 06/09/2024</span></em>]]></description>
                <pubDate>Sun, 29 Sep 2024 11:28:14 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Intelligence Artificielle]]></title>
                <link>https://www.mageialinux-online.org/wiki/intelligence-artificielle</link>
                <guid>https://www.mageialinux-online.org/wiki/intelligence-artificielle</guid>
                <description><![CDATA[Intelligence Artificielle, IA Générative]]></description>
                <pubDate>Sat, 07 Sep 2024 08:55:32 +0200</pubDate>
                
            </item>
		
	</channel>
</rss>
