<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AI Training Archives - OVHcloud Blog</title>
	<atom:link href="https://blog.ovhcloud.com/tag/ai-training/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.ovhcloud.com/tag/ai-training/</link>
	<description>Innovation for Freedom</description>
	<lastBuildDate>Thu, 19 Jun 2025 07:18:14 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.ovhcloud.com/wp-content/uploads/2019/07/cropped-cropped-nouveau-logo-ovh-rebranding-32x32.gif</url>
	<title>AI Training Archives - OVHcloud Blog</title>
	<link>https://blog.ovhcloud.com/tag/ai-training/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Reference Architecture: deploying the Mistral Large 123B model in a sovereign environment with OVHcloud</title>
		<link>https://blog.ovhcloud.com/reference-architecture-deploy-mistral-large-model-in-sovereign-environment-ovhcloud/</link>
		
		<dc:creator><![CDATA[Eléa Petton]]></dc:creator>
		<pubDate>Wed, 18 Jun 2025 12:45:51 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[AI Deploy]]></category>
		<category><![CDATA[AI Training]]></category>
		<category><![CDATA[Machine learning]]></category>
		<category><![CDATA[Mistral]]></category>
		<category><![CDATA[OVHcloud]]></category>
		<category><![CDATA[Public Cloud]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=29186</guid>

					<description><![CDATA[Are you ready to think bigger with the Mistral Large model 🚀 ? As Artificial Intelligence (AI) becomes a strategic pillar for both enterprises and public institutions, data sovereignty and infrastructure control have become essential. Deploying advanced large language models (LLMs) like Mistral Large, under a commercial license, requires a secure, high-performance environment that complies [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Freference-architecture-deploy-mistral-large-model-in-sovereign-environment-ovhcloud%2F&amp;action_name=Reference%20Architecture%3A%C2%A0deploying%20the%20Mistral%20Large%20123B%20model%20in%20a%20sovereign%20environment%20with%20OVHcloud&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p><em><strong>Are you ready to think bigger with the Mistral Large model 🚀 ?</strong></em></p>



<figure class="wp-block-image aligncenter size-large"><img fetchpriority="high" decoding="async" width="1024" height="461" src="https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_ref-1024x461.png" alt="" class="wp-image-29249" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_ref-1024x461.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_ref-300x135.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_ref-768x346.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_ref-1536x691.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_ref.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Mistral Large model deployed on OVHcloud infrastructure<br></em></figcaption></figure>



<p>As Artificial Intelligence (<strong>AI</strong>) becomes a strategic pillar for both enterprises and public institutions, <strong>data sovereignty</strong> and <strong>infrastructure control</strong> have become essential. Deploying advanced large language models (LLMs) like <strong>Mistral Large</strong>, under a commercial license, requires a secure, high-performance environment that complies with <strong>European data regulations</strong>.</p>



<p><strong>OVHcloud Machine Learning Services</strong> offer a trusted solution for deploying AI models in a <strong>fully sovereign cloud environment</strong> — hosted in Europe, under <strong>EU jurisdiction</strong>, and fully <strong>GDPR-compliant</strong>.</p>



<p>This <strong>Reference Architecture</strong> will show you how to:</p>



<ul class="wp-block-list">
<li>Access Mistral AI registry using your own license</li>



<li>Download the Mistral Large 123B model automatically using <strong>AI Training</strong></li>



<li>Store the model into a dedicated bucket with <strong>OVHcloud Object Storage</strong></li>



<li>Deploy a production-ready inference API for <strong>Mistral Large</strong> using <strong>AI Deploy</strong> </li>
</ul>



<h2 class="wp-block-heading">Context</h2>



<h3 class="wp-block-heading">Mistral Large model</h3>



<p>The <strong>Mistral Large</strong> model is a <strong>state-of-the-art (LLM)</strong> developed by <strong><a href="https://mistral.ai/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Mistral AI</a>,</strong> a French AI company. It&#8217;s designed to compete with top-tier models like GPT-4, Claude, while emphasizing performance and efficiency.</p>



<p>This is a model with <strong>123 billion</strong> parameters. <strong>Mistral AI</strong> recommends deploying this model in FP8 with 4 H100 GPUs. For more information, refer to <a href="https://help.mistral.ai/en/articles/235545-mistral-models" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Mistral documentation</a>.</p>



<p>This model requires the use of a <strong>commercial licence</strong>. To do this, you need to create an account on <a href="https://console.mistral.ai/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">La Plateforme</a> via the Mistral AI console (<strong>console.mistral.ai</strong>).</p>



<h3 class="wp-block-heading">AI Training </h3>



<p><strong>OVHcloud AI Training</strong> is a fully managed platform designed to help you <strong>train, tune</strong> Machine Learning (ML), Deep Learning (DL), and Large Language Models (LLMs) efficiently. Whether you&#8217;re working on computer vision, NLP, or tabular data, this solution lets you launch training jobs on high-performance GPUs in seconds.</p>



<p><strong>What are the key benefits?</strong></p>



<ul class="wp-block-list">
<li><strong>Easy to use</strong>: launch processing or training jobs in one CLI command or a few clicks using your own Docker image</li>



<li><strong>High-performance computing</strong>: access GPUs like H100, A100, V100S, L40S, and L4 as of June 2025 &#8211; new references are added regularly</li>



<li><strong>Cost-efficient</strong>:<strong> </strong>pay-per-minute billing with no upfront commitment. You only pay for compute time used, with precise control over resources thanks to automatic job stop and synchronisation</li>
</ul>



<p><strong>💡 Why do we need AI Training? </strong>To download the Mistral Large model automatically and efficiently, using a single command to launch the job.</p>



<h3 class="wp-block-heading">AI Deploy</h3>



<p>OVHcloud AI Deploy is a<strong>&nbsp;Container as a Service</strong>&nbsp;(CaaS) platform designed to help you deploy, manage and scale AI models. It provides a solution that allows you to optimally deploy your applications / APIs based on Machine Learning (ML), Deep Learning (DL) or LLMs.</p>



<p><strong>The key benefits are:</strong></p>



<ul class="wp-block-list">
<li><strong>Easy to use:</strong>&nbsp;bring your own custom Docker image and deploy it in a command line or a few clicks surely</li>



<li><strong>High-performance computing:</strong>&nbsp;a complete range of GPUs available (H100, A100, V100S, L40S and L4)</li>



<li><strong>Scalability and flexibility:</strong>&nbsp;supports automatic scaling, allowing your model to effectively handle fluctuating workloads</li>



<li><strong>Cost-efficient:</strong>&nbsp;billing per minute, no surcharges</li>
</ul>



<p>✅ To go further, some prerequisites must be checked!</p>



<h2 class="wp-block-heading">Overview of the Mistral Large deployment architecture</h2>



<p>Here is how will be deployed <strong>Mistral Large 123B</strong>:</p>



<ol class="wp-block-list">
<li>Install the <strong>ovhai CLI</strong></li>



<li>Create a bucket for <strong>model storage</strong></li>



<li>Retrieve the <strong>license information</strong> from <a href="https://console.mistral.ai/on-premise/licenses" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Mistral Console</a></li>



<li>Configure and set up the<strong> environment</strong></li>



<li>Download the <strong>Mistral Large model weights</strong></li>



<li>Deploy the <strong>Mistral Large service</strong></li>



<li>Test it with simple request and <strong>advanced usage</strong> thanks to LangChain</li>
</ol>



<figure class="wp-block-image aligncenter size-large"><img decoding="async" width="1024" height="173" src="https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_process-1024x173.png" alt="" class="wp-image-29251" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_process-1024x173.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_process-300x51.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_process-768x130.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_process-1536x259.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/06/mistral_large_archi_process.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Let’s go for the set up and deployment of your own Mistral Large service!</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before you begin, ensure you have:</p>



<ul class="wp-block-list">
<li>A <strong><a href="https://console.mistral.ai/on-premise/licenses" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Mistral AI license</a></strong> to access to the <strong>Mistral Large model</strong></li>



<li>An&nbsp;<strong>OVHcloud Public Cloud</strong>&nbsp;account</li>



<li>An&nbsp;<strong>OpenStack user</strong>&nbsp;with the following roles:
<ul class="wp-block-list">
<li>Administrator</li>



<li>AI Training Operator</li>



<li>Object Storage Operator</li>
</ul>
</li>
</ul>



<p><strong>🚀 Having all the ingredients for our recipe, it’s time to </strong>deploy the Mistral Large model on 4 H100<strong>!</strong></p>



<h2 class="wp-block-heading">Architecture guide:&nbsp;Mistral Large on OVHcloud infrastructure</h2>



<p>Let’s go for the set up and deployment of the <strong>Mistral Large</strong> model!</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>✅ Note</strong></p>
<cite><strong>In this example, the <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><code>Mistral Large 25.02</code></mark> is used. Choose the mistral model under the licence of your choice and repeat the same steps, adapting the model name and versions.</strong></cite></blockquote>



<p>⚙️<em>&nbsp;Also consider that all of the following steps can be automated using OVHcloud APIs!</em></p>



<h3 class="wp-block-heading">Step 1 &#8211; Install&nbsp;<code>ovhai</code>&nbsp;CLI</h3>



<p>If the <code><strong>ovhai</strong></code> CLI is not install, start by setting up your CLI environment.</p>



<pre class="wp-block-code"><code class="">curl https://cli.gra.ai.cloud.ovh.net/install.sh | bash</code></pre>



<p>Secondly, login using your&nbsp;<strong>OpenStack credentials</strong>.</p>



<pre class="wp-block-code"><code class="">ovhai login -u &lt;openstack-username&gt; -p &lt;openstack-password&gt;</code></pre>



<p>Now, it’s time to create your bucket inside OVHcloud Object Storage!</p>



<h3 class="wp-block-heading">Step 2 – Provision Object Storage</h3>



<ol class="wp-block-list">
<li>Go to&nbsp;<strong>Public Cloud &gt; Storage &gt; Object Storage</strong>&nbsp;in the OVHcloud Control Panel.</li>



<li>Create a&nbsp;<strong>datastore</strong>&nbsp;and a new&nbsp;<strong>S3 bucket</strong>&nbsp;(e.g.,&nbsp;<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><code>s3-mistral-large-model</code>)</mark></strong>.</li>



<li>Register the datastore with the&nbsp;<code>ovhai</code>&nbsp;CLI:</li>
</ol>



<pre class="wp-block-code"><code class="">ovhai datastore add s3 &lt;ALIAS&gt; https://s3.gra.perf.cloud.ovh.net/ gra &lt;my-access-key&gt; &lt;my-secret-key&gt; --store-credentials-locally</code></pre>



<p>💡 <em>Note that, for this use case, we recommend the <strong>High Performance Object Storage</strong> range using <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><strong>https://s3.gra.perf.cloud.ovh.net/</strong></mark></code> instead of <code>https://s3.gra.io.cloud.ovh.net/</code></em></p>



<h3 class="wp-block-heading">Step 3 &#8211; Access the Mistral AI registry</h3>



<p><em>⚠️ Please note that you must have a <strong>licence for the Mistral Large model </strong>to be able to carry out the following steps.</em></p>



<ul class="wp-block-list">
<li>Go to the Mistral AI platform: <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">https://console.mistral.ai/home</mark></strong></li>



<li>Retrieve <strong>credentials</strong> and the <strong>license key</strong> from the Mistral console:<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"> https://console.mistral.ai/on-premise/licenses</mark></strong></li>



<li>Authenticate to the Mistral AI Docker registry:</li>
</ul>



<pre class="wp-block-code"><code class="">docker login &lt;mistral-ai-registry&gt; --username $DOCKER_USERNAME --password $DOCKER_PASSWORD</code></pre>



<ul class="wp-block-list">
<li>Add the private registry to the config using the <code><strong>ovhai</strong></code> CLI:</li>
</ul>



<pre class="wp-block-code"><code class="">ovhai registry add &lt;mistral-ai-registry&gt;</code></pre>



<ul class="wp-block-list">
<li>Check that it is present in the list:</li>
</ul>



<pre class="wp-block-code"><code class="">ovhai registry list</code></pre>



<h3 class="wp-block-heading">Step 4 &#8211; Define environment variables</h3>



<p>The next step is to define an<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"> <strong><code>.env</code></strong></mark> file that will list all the environment variables required to download and deploy the Mistral Large model.</p>



<ul class="wp-block-list">
<li>Create the <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><strong><code>.env</code></strong></mark> file, enter the following information:</li>
</ul>



<pre class="wp-block-code"><code class=""><code>SERVED_MODEL=mistral-large-2502
RECIPES_VERSION=v0.0.76TP_SIZE=4
LICENSE_KEY=&lt;your-mistral-license-key&gt;
DOCKER_IMAGE_INFERENCE_ENGINE=&lt;<span style="background-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit;">mistral-inference-server</span>-docker-image&gt;
DOCKER_IMAGE_MISTRAL_UTILS=<span style="background-color: rgba(248, 248, 242, 0.2); font-family: inherit; font-size: inherit; font-weight: inherit;">&lt;</span><span style="font-family: inherit; font-size: inherit; font-weight: inherit; background-color: initial;">mistral-utils</span><span style="background-color: rgba(248, 248, 242, 0.2); font-family: inherit; font-size: inherit; font-weight: inherit;">-docker-image&gt;</span></code></code></pre>



<ul class="wp-block-list">
<li>Then, create a script to load theses environment variables easily. Name it <code><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">load_env.sh</mark></strong></code>:</li>
</ul>



<pre class="wp-block-code"><code class="">#!/bin/bash

# Vérifie si le fichier .env existe
if [ ! -f .env ]; then
  echo "Error: .env not found"
  exit 1
fi

# Exporter toutes les variables du .env
export $(grep -v '^#' .env | xargs)

echo "Environment variables are loaded from .env"</code></pre>



<ul class="wp-block-list">
<li>Now, launch this script :</li>
</ul>



<pre class="wp-block-code"><code class="">source load_env.sh</code></pre>



<p>✅ You have everything you need to start the implementation!</p>



<h3 class="wp-block-heading">Step 5 &#8211; Download Mistral Large model weights</h3>



<p>The aim here is to download the model and its artefacts into the S3 bucket created earlier.</p>



<p>To achieve this, you can launch a download job that will run automatically with AI Training.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong> 💡 Here&#8217;s a tip! </strong></p>
<cite><strong>Note that here you are not using AI Training to train models, but as an easy-to-use Container as a Service solution. With a single command line, you can launch a one-shot download of the Mistral Large model with automatic synchronisation to Object Storage.</strong></cite></blockquote>



<ul class="wp-block-list">
<li>Launch the <strong>AI Training</strong> download job by attaching the object container:</li>
</ul>



<pre class="wp-block-code"><code class="">ovhai job run --name DOWNLOAD_MISTRAL_LARGE_123B \
              --cpu 12 \
              --volume s3-mistral-large-model@&lt;ALIAS&gt;/:/opt/ml/model:RW \
              -e RECIPES_VERSION=$RECIPES_VERSION \
              $<span style="background-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit;">DOCKER_IMAGE_MISTRAL_UTILS</span> \
                -- bash -c "cd /app/mistral-rclone &amp;&amp; \ 
                  poetry run python mistral-rclone.py \
                  --license-key $LICENSE_KEY \
                  --download-model $SERVED_MODEL"</code></pre>



<p><em>Full command explained:</em></p>



<ul class="wp-block-list">
<li><code>ovhai job run</code></li>
</ul>



<p>This is the core command to&nbsp;<strong>run a job</strong>&nbsp;using the&nbsp;<strong>OVHcloud AI Training</strong>&nbsp;platform.</p>



<ul class="wp-block-list">
<li><code>--name DOWNLOAD_MISTRAL_LARGE_123B</code></li>
</ul>



<p>Sets a&nbsp;<strong>custom name</strong>&nbsp;for the job. For example,&nbsp;<code><code>DOWNLOAD_MISTRAL_LARGE_123B</code></code>.</p>



<ul class="wp-block-list">
<li><code>--cpu&nbsp;12</code></li>
</ul>



<p>Allocates&nbsp;<strong>12 CPU</strong>&nbsp;for the job.</p>



<ul class="wp-block-list">
<li><code>--volume s3-mistral-large-model@&lt;ALIAS&gt;/:/opt/ml/model:RW</code></li>
</ul>



<p>This mounts your&nbsp;<strong>OVHcloud Object Storage volume</strong>&nbsp;into the job’s file system:<br>–&nbsp;<code>s3-mistral-large-model@&lt;ALIAS&gt;/</code>: refers to your&nbsp;<strong>S3 bucket volume</strong>&nbsp;from the OVHcloud Object Storage<br>–&nbsp;<code>:<code>/opt/ml/model</code></code>: mounts the volume into the container under&nbsp;<code><code>/opt/ml/model</code></code><br>–&nbsp;<code>RW</code>: enables&nbsp;<strong>Read/Write</strong>&nbsp;permissions</p>



<ul class="wp-block-list">
<li><code>-e RECIPES_VERSION=$RECIPES_VERSION</code></li>
</ul>



<p>This is from your <strong>environment variables</strong>&nbsp;defined previously.</p>



<ul class="wp-block-list">
<li><code>$<span style="background-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit;">DOCKER_IMAGE_MISTRAL_UTILS</span></code></li>
</ul>



<p>This is the<strong>&nbsp;Mistral Large utils Docker image</strong>&nbsp;you are running inside the job.</p>



<ul class="wp-block-list">
<li><code>-- bash -c "cd /app/mistral-rclone &amp;&amp; \</code><br><code>               poetry run python mistral-rclone.py \</code><br><code>                   --license-key $LICENSE_KEY \</code><br><code>                   --download-model $SERVED_MODEL"</code></li>
</ul>



<p>Refers to the specific command to <strong>launch the model download</strong>.</p>



<p><em>Note that synchronisation with Object Storage will be <strong>automatic at the end of the AI Training job</strong>.</em></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>⚠️ <strong>WARNING!</strong></p>
<cite><strong>Wait for the job to go to <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">DONE</mark></code> before proceeding to the next step</strong>.</cite></blockquote>



<ul class="wp-block-list">
<li>Check that the various elements are present in the bucket:</li>
</ul>



<pre class="wp-block-code"><code class="">ovhai bucket object list s3-mistral-large-model@&lt;ALIAS&gt;</code></pre>



<p>The bucket must be organized and split into 4 different folders:</p>



<ul class="wp-block-list">
<li>grammars</li>



<li>recipes</li>



<li>tokenizers</li>



<li>weights</li>
</ul>



<p>Note that a total of 6 elements must be present.</p>



<p>🚀 It&#8217;s all there? So let&#8217;s move on to the <strong>deployment of the Mistral Large model</strong>!</p>



<h3 class="wp-block-heading">Step 6 &#8211; Deploy Mistral Large service</h3>



<p>To deploy the Mistral Large 123B model using the previously downloaded weights, you will use OVHcloud&#8217;s <strong>AI Deploy </strong>product.</p>



<p>But first you need to create an API key that will allow you to consume the model and query it, in particular using Open AI compatibility.</p>



<ul class="wp-block-list">
<li>Creation of an access token:</li>
</ul>



<pre class="wp-block-code"><code class="">ovhai token create --role read mistral_large=api_key_reader</code></pre>



<ul class="wp-block-list">
<li>Export this token as an environment variable:</li>
</ul>



<pre class="wp-block-code"><code class="">export MY_OVHAI_MISTRAL_LARGE_TOKEN=&lt;your_ovh_access_token_value&gt;</code></pre>



<ul class="wp-block-list">
<li>Launch the <strong>Mistral Large service</strong> with <strong>AI Deploy </strong>by running the following command:</li>
</ul>



<pre class="wp-block-code"><code class="">ovhai app run --name DEPLOY_MISTRAL_LARGE_123B \
              --gpu 4 \
              --flavor h100-1-gpu \
              --default-http-port 5000 \
              --label mistral_large=api_key_reader \
              -e SERVED_MODEL=$SERVED_MODEL \
              -e RECIPES_VERSION=$RECIPES_VERSION \
              -e TP_SIZE=$TP_SIZE \
              --volume s3-mistral-large-model@&lt;ALIAS&gt;/:/opt/ml/model:RW \
              --volume standalone:/tmp:RW \
              --volume standalone:/workspace:RW \
              $<span style="background-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit;">DOCKER_IMAGE_INFERENCE_ENGINE</span></code></pre>



<p><em>Full command explained:</em></p>



<ul class="wp-block-list">
<li><code>ovhai app run</code></li>
</ul>



<p>This is the core command to&nbsp;<strong>run an app / API</strong>&nbsp;using the&nbsp;<strong>OVHcloud AI Deploy</strong>&nbsp;platform.</p>



<ul class="wp-block-list">
<li><code>--name DEPLOY_MISTRAL_LARGE_123B</code></li>
</ul>



<p>Sets a&nbsp;<strong>custom name</strong>&nbsp;for the app. For example,&nbsp;<code>DEPLOY_MISTRAL_LARGE_123B</code>.</p>



<ul class="wp-block-list">
<li><code>--default-http-port 5000</code></li>
</ul>



<p>Exposes&nbsp;<strong>port 5000</strong>&nbsp;as the default HTTP endpoint.</p>



<ul class="wp-block-list">
<li><code>--gpu&nbsp;</code>4</li>
</ul>



<p>Allocates&nbsp;<strong>4 GPUs</strong>&nbsp;for the app.</p>



<ul class="wp-block-list">
<li><code>--flavor h100-1-gpu</code></li>
</ul>



<p>Chooses&nbsp;<strong>H100 GPUs</strong>&nbsp;for the app.</p>



<ul class="wp-block-list">
<li><code>--volume s3-mistral-large-model@&lt;ALIAS&gt;/:/opt/ml/model:RW</code></li>
</ul>



<p>This mounts your&nbsp;<strong>OVHcloud Object Storage volume</strong>&nbsp;into the job’s file system:<br>–&nbsp;<code>s3-mistral-large-model@&lt;ALIAS&gt;/</code>: refers to your&nbsp;<strong>S3 bucket volume</strong>&nbsp;from the OVHcloud Object Storage<br>–&nbsp;<code>:<code>/opt/ml/model</code></code>: mounts the volume into the container under&nbsp;<code><code>/opt/ml/model</code></code><br>–&nbsp;<code>RW</code>: enables&nbsp;<strong>Read/Write</strong>&nbsp;permissions</p>



<ul class="wp-block-list">
<li><code>--label mistral_large=api_key_reader</code></li>
</ul>



<p>Means that the access is restricted to your token</p>



<ul class="wp-block-list">
<li><code>-e SERVED_MODEL=$SERVED_MODEL</code></li>



<li><code>-e RECIPES_VERSION=$RECIPES_VERSION</code></li>



<li><code>-e TP_SIZE=$TP_SIZE</code></li>
</ul>



<p>These are&nbsp;<strong>environment variables</strong>&nbsp;defined previously.</p>



<ul class="wp-block-list">
<li><code>-v standalone:/tmp:rw</code></li>



<li><code>-v standalone:/workspace:rw</code></li>
</ul>



<p>Mounts&nbsp;<strong>two persistent storage volumes</strong>:<br>&#8211; <code>/tmp</code><br>&#8211; <code>/workspace</code>&nbsp;→ Main working directory</p>



<ul class="wp-block-list">
<li><code>$<span style="background-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit;">DOCKER_IMAGE_INFERENCE_ENGINE</span></code></li>
</ul>



<p>This is the<strong>&nbsp;Mistral Large inference Docker image</strong>&nbsp;you are running inside the app.</p>



<p><em>It&nbsp;may&nbsp;take&nbsp;a&nbsp;few&nbsp;minutes&nbsp;for&nbsp;the&nbsp;resources&nbsp;to&nbsp;be&nbsp;allocated&nbsp;and&nbsp;for&nbsp;the&nbsp;<strong>Docker image</strong>&nbsp;to&nbsp;be&nbsp;pulled.&nbsp;</em></p>



<p>To&nbsp;check&nbsp;the&nbsp;progress&nbsp;and&nbsp;get&nbsp;additional&nbsp;information&nbsp;about&nbsp;the&nbsp;<strong>AI&nbsp;deploy&nbsp;app</strong>,&nbsp;run&nbsp;the&nbsp;following&nbsp;command:</p>



<pre class="wp-block-code"><code class="">ovhai app get &lt;ai_deploy_mistral_app_id&gt;</code></pre>



<p>Once in <strong><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">RUNNING</mark></code></strong> status, the model will be loaded. To check that the load was successful, you can check the container logs:</p>



<pre class="wp-block-code"><code class="">ovhai app logs &lt;ai_deploy_mistral_app_id&gt;</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>⚠️ <strong>WARNING!</strong></p>
<cite><strong>To&nbsp;consume&nbsp;the&nbsp;service,&nbsp;you&nbsp;must&nbsp;wait&nbsp;for&nbsp;the&nbsp;app&nbsp;to&nbsp;go&nbsp;into&nbsp;<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">RUNNING</mark></code>&nbsp;status,&nbsp;AND&nbsp;for&nbsp;the&nbsp;model&nbsp;to&nbsp;finish&nbsp;loading.</strong></cite></blockquote>



<p>🎉 Is&nbsp;that&nbsp;it?&nbsp;Everything&nbsp;ready?&nbsp;It&nbsp;is&nbsp;therefore&nbsp;possible&nbsp;to&nbsp;start&nbsp;playing&nbsp;with&nbsp;the&nbsp;model!</p>



<h3 class="wp-block-heading">Step 7 &#8211; Test the Mistral Large model by sending your first requests</h3>



<ul class="wp-block-list">
<li>Access the API doc via your app URL:</li>
</ul>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><code><strong>https://&lt;ai_deploy_mistral_app_id>.app.gra.ai.cloud.ovh.net/docs</strong></code></mark></p>



<p>To find the information, please refer to <a href="https://console.mistral.ai/on-premise/licenses" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer"><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">https://console.mistral.ai/on-premise/licenses</mark></strong></a></p>



<ul class="wp-block-list">
<li>Test with a basic cURL:</li>
</ul>



<pre class="wp-block-code"><code class="">curl -X 'POST' \
'https://&lt;ai_deploy_mistral_app_id&gt;.app.gra.ai.cloud.ovh.net/v1/chat/completions' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $MY_OVHAI_MISTRAL_LARGE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "mistral-large-&lt;version&gt;",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant!"
    },
    {
      "role": "user",
      "content": "What is the capital of France?"     
    }
  ]
}'</code></pre>



<p><strong>⚠️ Note that you have also to replace <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><code>&lt;version&gt;</code></mark> in the model name by the one you are using: </strong><br><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><code><strong>"model": "mistral-large-&lt;version&gt;"</strong></code></mark></p>



<p>To take implementation a step further and take advantage of all the features of this endpoint, you can also integrate it with <strong>Langchain</strong> thanks to its fuOpenAI compatibility.</p>



<ul class="wp-block-list">
<li>LangChain integration:</li>
</ul>



<pre class="wp-block-code"><code class="">import time
import os 
from langchain.chat_models import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate

def chat_completion_basic(new_message: str):

  model = ChatOpenAI(model_name="mistral-large-&lt;version&gt;",
                        openai_api_key=$MY_OVHAI_MISTRAL_LARGE_TOKEN,
                        openai_api_base='https://&lt;ai_deploy_mistral_app_id&gt;.app.gra.ai.cloud.ovh.net/v1',
                       )

  prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant!"),
    ("human", "{question}"),
  ])

  chain = prompt | model

  print("🤖: ")
  for r in chain.stream({"question", new_message}):
    print(r.content, end="", flush=True)
    time.sleep(0.150)

chat_completion_basic("What is the capital of France?)</code></pre>



<p>🥹 Congratulations! You have successfully completed the deployment!</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>You can now consume your <strong>Mistral Large 123B</strong> in a secure environment!</p>



<p>The result of your implementation? The deployment of a sovereign, scalable, production-quality 123B LLM, powered by <strong>OVHcloud AI Deploy</strong>.</p>



<p>➡️ <strong>To go further? </strong></p>



<ul class="wp-block-list">
<li>Update your model in a single command line and without interruption following this <a href="https://help.ovhcloud.com/csm/en-gb-public-cloud-ai-deploy-update-custom-docker-image?id=kb_article_view&amp;sysparm_article=KB0057968" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">documentation</a></li>



<li>Go to the next replica in the event of a heavy load to ensure high availability using this <a href="https://help.ovhcloud.com/csm/en-gb-public-cloud-ai-deploy-apps-deployments?id=kb_article_view&amp;sysparm_article=KB0047997" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">method</a></li>
</ul>
<img decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Freference-architecture-deploy-mistral-large-model-in-sovereign-environment-ovhcloud%2F&amp;action_name=Reference%20Architecture%3A%C2%A0deploying%20the%20Mistral%20Large%20123B%20model%20in%20a%20sovereign%20environment%20with%20OVHcloud&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Reference Architecture: set up MLflow Remote Tracking Server on OVHcloud</title>
		<link>https://blog.ovhcloud.com/mlflow-remote-tracking-server-ovhcloud-databases-object-storage-ai-solutions/</link>
		
		<dc:creator><![CDATA[Eléa Petton]]></dc:creator>
		<pubDate>Tue, 15 Apr 2025 07:52:46 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[AI Notebooks]]></category>
		<category><![CDATA[AI Training]]></category>
		<category><![CDATA[Machine learning]]></category>
		<category><![CDATA[Managed Database]]></category>
		<category><![CDATA[MLflow]]></category>
		<category><![CDATA[Object Storage]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[OVHcloud]]></category>
		<category><![CDATA[Public Cloud]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=28564</guid>

					<description><![CDATA[Travel through the Data &#38; AI universe of OVHcloud with the MLflow integration. As Artificial Intelligence (AI) continues to grow in importance, Data Scientists and Machine Learning Engineers need a robust and scalable platform to manage the entire Machine Learning (ML) lifecycle. MLflow, an open-source platform, provides a comprehensive framework for managing ML experiments, models, [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fmlflow-remote-tracking-server-ovhcloud-databases-object-storage-ai-solutions%2F&amp;action_name=Reference%20Architecture%3A%20set%20up%20MLflow%20Remote%20Tracking%20Server%20on%20OVHcloud&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p><em>Travel through the Data &amp; AI universe of OVHcloud with the <em>MLflow</em> integration.</em></p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/mlflow_ref_archi.svg" alt="" class="wp-image-28689"/><figcaption class="wp-element-caption"><em>Mlflow Remote Tracking Server on OVHcloud</em></figcaption></figure>



<p>As <strong>Artificial Intelligence</strong> (AI) continues to grow in importance, <em>Data Scientists</em> and <em>Machine Learning Engineers</em> need a robust and scalable platform to manage the entire Machine Learning (ML) lifecycle. <br><a href="https://mlflow.org/docs/latest/introduction/index.html" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">MLflow</a>, an open-source platform, provides a comprehensive framework for managing ML experiments, models, and deployments. </p>



<p><strong>Mlflow</strong> offers many benefits and provides a complete framework for ML lifecycle management with features such as:</p>



<ul class="wp-block-list">
<li>Experiment tracking and model management</li>



<li>Reproducibility and collaboration</li>



<li>Scalability, flexibility, and integration</li>



<li>Automated ML and model serving capabilities</li>



<li>Improved model accuracy, faster time-to-market, and reduced costs.</li>
</ul>



<p>In this reference architecture, you will explore how to leverage remote experience tracking with the <strong>MLflow Tracking Server</strong> on the <a href="https://www.ovhcloud.com/fr/public-cloud/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">OVHcloud Public Cloud</a> infrastructure.<br>In fact, you will be able to build a scalable and efficient ML platform, streamlining your ML workflow and accelerating model development using <strong>OVHcloud AI Notebooks</strong>, <strong>AI Training</strong>, <strong>Managed Databases (PostgreSQL)</strong>, and <strong>Object Storage</strong>.</p>



<p><strong>The result?</strong> A fully remote, <strong>production-ready ML experiment tracking pipeline</strong>, powered by OVHcloud&#8217;s Data &amp; Machine Learning Services (e.g. AI Notebooks and AI Training).</p>



<h2 class="wp-block-heading">Overview of the MLflow server architecture</h2>



<p>Here is how will be configured MLflow:</p>



<ul class="wp-block-list">
<li><strong>Development and training environment:</strong> create and train model with <strong>AI Notebooks</strong></li>



<li><strong>Remote Tracking Server</strong>: host in an <strong>AI Training</strong> job (Container as a Service)</li>



<li><strong>Backend Store</strong>: benefit from a managed <strong>PostgreSQL</strong> database (DBaaS).</li>



<li><strong>Artifact Store</strong>: use OVHcloud <strong>Object Storage</strong> (S3-compatible).</li>
</ul>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/mlflow_overview.svg" alt="" class="wp-image-28688"/><figcaption class="wp-element-caption"><em>MLflow remote server deployment steps</em></figcaption></figure>



<p>In the following tutorial, all services are deployed within the <strong>OVHcloud Public Cloud</strong>.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before you begin, ensure you have:</p>



<ul class="wp-block-list">
<li>An <strong>OVHcloud Public Cloud</strong> account</li>



<li>An <strong>OpenStack user</strong> with the following roles:
<ul class="wp-block-list">
<li>Administrator</li>



<li>AI Training Operator</li>



<li>Object Storage Operator</li>
</ul>
</li>
</ul>



<p><strong>🚀 Having all the ingredients for our recipe, it’s time to set up your MLflow remote tracking server!</strong></p>



<h2 class="wp-block-heading">Architecture guide: MLflow remote tracking server</h2>



<p>Let’s go for the set up and deployment of your custom MLflow tracking tool!</p>



<p>⚙️<em> Also consider that all of the following steps can be automated using OVHcloud APIs!</em></p>



<h4 class="wp-block-heading">Step 1 – Install <code>ovhai</code> CLI</h4>



<p>Firstly, start by setting up your CLI environment.</p>



<pre class="wp-block-code"><code class="">curl https://cli.gra.ai.cloud.ovh.net/install.sh | bash</code></pre>



<p>Secondly, login using your <strong>OpenStack credentials</strong>.</p>



<pre class="wp-block-code"><code class="">ovhai login -u &lt;openstack-username&gt; -p &lt;openstack-password&gt;</code></pre>



<p>Now, it&#8217;s time to create your bucket inside OVHcloud Object Storage!</p>



<h4 class="wp-block-heading">Step 2 – Provision Object Storage (Artifact Store)</h4>



<ol class="wp-block-list">
<li>Go to <strong>Public Cloud &gt; Storage &gt; Object Storage</strong> in the OVHcloud Control Panel.</li>



<li>Create a <strong>datastore</strong> and a new <strong>S3 bucket</strong> (e.g., <code>mlflow-s3-bucket</code>).</li>



<li>Register the datastore with the <code>ovhai</code> CLI:</li>
</ol>



<pre class="wp-block-code"><code class="">ovhai datastore add s3 &lt;ALIAS&gt; https://s3.gra.io.cloud.ovh.net/ gra &lt;my-access-key&gt; &lt;my-secret-key&gt; --store-credentials-locally</code></pre>



<h4 class="wp-block-heading">Step 3 – Create PostgreSQL Managed DB (Backend Store)</h4>



<p>1. Navigate to <strong>Databases &amp; Analytics &gt; Databases</strong></p>



<p><strong>2. Create a new <em>PostgreSQL</em> instance with <em>Essential plan</em></strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="627" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-13-1024x627.png" alt="" class="wp-image-28580" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-13-1024x627.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-13-300x184.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-13-768x470.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-13-1536x941.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-13-2048x1254.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>3. Select <em>Location</em> and <em>Node type</em></strong></p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="661" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-14-1024x661.png" alt="" class="wp-image-28581" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-14-1024x661.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-14-300x194.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-14-768x495.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-14-1536x991.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-14-2048x1321.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>4. Reset the user password</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="2384" height="1340" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-15-edited.png" alt="" class="wp-image-28590" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-15-edited.png 2384w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-15-edited-300x169.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-15-edited-1024x576.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-15-edited-768x432.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-15-edited-1536x863.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-15-edited-2048x1151.png 2048w" sizes="auto, (max-width: 2384px) 100vw, 2384px" /></figure>



<p><strong>5. Take note of te following parameters</strong></p>



<p>Go to your database dashboard:</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="640" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-16-1024x640.png" alt="" class="wp-image-28583" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-16-1024x640.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-16-300x188.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-16-768x480.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-16-1536x960.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-16-2048x1280.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Then, copy the <strong>connexion information</strong>:</p>



<pre class="wp-block-code"><code class="">&lt;db_hostname&gt;
&lt;db_username&gt;
&lt;db_password&gt;
&lt;db_name&gt;
&lt;db_port&gt;
&lt;ssl_mode&gt;</code></pre>



<p>Your <strong>Backend Store</strong> is now ready to use!</p>



<h4 class="wp-block-heading">Step 4 -Build you custom MLflow Docker image and </h4>



<p>1. Develop MLflow launching script</p>



<p>Firstly, you have to write a script in bash to launch the server: <strong><em>mlflow_server.sh</em></strong></p>



<pre class="wp-block-code"><code class="">echo "The MLflow server is starting..."

mlflow server \
  --backend-store-uri postgresql://${POSTGRE_USER}:${POSTGRE_PASSWORD}@${PG_HOST}:${PG_PORT}/${PG_DB}?sslmode=${SSL_MODE} \
  --default-artifact-root ${S3_BUCKET_NAME}/ \
  --host 0.0.0.0 \
  --port 5000</code></pre>



<p><strong>2. Create Dockerfile</strong></p>



<p>Install the required Python dependency and give the rights on the<strong> /mlruns</strong> path to the OVHcloud user.</p>



<pre class="wp-block-code"><code class="">FROM ghcr.io/mlflow/mlflow:latest

# Install Python dependencies
RUN pip install psycopg2-binary

COPY mlflow_server.sh .

# Change the ownership of `mlruns` directory to the OVHcloud user (42420:42420)
RUN mkdir -p /mlruns
RUN chown -R 42420:42420 /mlruns

# Start MLflow server inside container
CMD ["bash", "mlflow_server.sh"]</code></pre>



<p><strong>3. Build your custom MLflow docker image</strong></p>



<p>Build the docker image using the previous Dockerfile.</p>



<pre class="wp-block-code"><code class="">docker build . -t mlflow-server-ai-training:latest</code></pre>



<p><strong>4. Tag and push the docker image to your registry</strong></p>



<p>Finally, you can push the Docker image to your registry.</p>



<pre class="wp-block-code"><code class="">docker tag mlflow-server-ai-training:latest &lt;your-registry-address&gt;/mlflow-server-ai-training:latest</code></pre>



<pre class="wp-block-code"><code class="">docker push &lt;your-registry-address&gt;/mlflow-server-ai-training:latest</code></pre>



<p>Congrats! You can now use the Docker image to launch MLflow server.</p>



<h4 class="wp-block-heading">Step 5 &#8211; Start MLflow Tracking Server inside container</h4>



<p>You can use AI Training to start MLflow server inside a job.</p>



<p><strong>1. Using <code>ovhai</code> CLI, run the following command inside terminal</strong></p>



<pre class="wp-block-code"><code class="">ovhai job run --name mlflow-server \
              --default-http-port 5000 \
              --cpu 4 \
              -v mlflow-s3-bucket@DEMO/:/artifacts:RW:cache \
              -e POSTGRE_USER=avnadmin \
              -e POSTGRE_PASSWORD=&lt;db_password&gt; \
              -e S3_ENDPOINT=https://s3.gra.io.cloud.ovh.net/ \
              -e S3_BUCKET_NAME=mlflow-s3-bucket \
              -e PG_HOST=&lt;db_hostname&gt; \
              -e PG_DB=defaultdb \
              -e PG_PORT=20184 \
              -e SSL_MODE=require \
              &lt;your_registry_address&gt;/mlflow-server-ai-training:latest</code></pre>



<p><em>Full command explained:</em></p>



<ul class="wp-block-list">
<li><code>ovhai job run</code></li>
</ul>



<p>This is the core command to <strong>run a job</strong> using the <strong>OVHcloud AI Training</strong> platform.</p>



<ul class="wp-block-list">
<li><code>--name mlflow-server</code></li>
</ul>



<p>Sets a <strong>custom name</strong> for the job. For example, <code>mlflow-server</code>.</p>



<ul class="wp-block-list">
<li><code>--default-http-port 5000</code></li>
</ul>



<p>Exposes <strong>port 5000</strong> as the default HTTP endpoint. MLflow’s web UI typically runs on port 5000, so this ensures the UI is accessible once the job is running.</p>



<ul class="wp-block-list">
<li><code>--cpu </code>4</li>
</ul>



<p>Allocates <strong>4 CPUs</strong> for the job. You can adjust this based on how heavy your MLflow workload is.</p>



<ul class="wp-block-list">
<li><code>-v mlflow-s3-bucket@DEMO/:/artifacts:RW:cache</code></li>
</ul>



<p>This mounts your <strong>OVHcloud Object Storage volume</strong> into the job’s file system:<br>&#8211; <code>mlflow-s3-bucket@DEMO/</code>: refers to your <strong>S3 bucket volume</strong> from the OVHcloud Object Storage<br>&#8211; <code>:/artifacts</code>: mounts the volume into the container under <code>/artifacts</code><br>&#8211; <code>RW</code>: enables <strong>Read/Write</strong> permissions<br>&#8211; <code>cache</code>: enables <strong>volume caching</strong>, improving performance for frequent reads/writes</p>



<ul class="wp-block-list">
<li><code>-e POSTGRE_USER=avnadmin</code></li>



<li><code>-e POSTGRE_PASSWORD=&lt;db_password&gt;</code></li>



<li><code>-e PG_HOST=&lt;db_hostname&gt;</code></li>



<li><code>-e PG_DB=defaultdb</code></li>



<li><code>-e PG_PORT=20184</code></li>



<li><code>-e SSL_MODE=require</code></li>
</ul>



<p>These are <strong>environment variables</strong> for connecting to the <strong>PostgreSQL </strong>backend store:<br>&#8211; <code>avnadmin</code>: the default admin user for OVHcloud’s managed PostgreSQL<br>&#8211; <code>POSTGRE_PASSWORD</code>: must be replaced with your actual database password<br>&#8211; <code>PG_HOST</code>: the hostname of your managed PostgreSQL instance<br>&#8211; <code>PG_DB</code>: the name of the database to use (default: <code>defaultdb</code>)<br>&#8211; <code>PG_PORT</code>: the port your PostgreSQL server is listening on<br>&#8211; <code>SSL_MODE</code>: enforce SSL connection to secure DB traffic</p>



<ul class="wp-block-list">
<li><code>-e S3_ENDPOINT=https://s3.gra.io.cloud.ovh.net/</code></li>
</ul>



<p>Tells MLflow where the <strong>S3-compatible endpoint</strong> is hosted. This is specific to OVHcloud&#8217;s GRA (Gravelines) region Object Storage.</p>



<ul class="wp-block-list">
<li><code>-e S3_BUCKET_NAME=mlflow-s3-bucket</code></li>
</ul>



<p>Sets the <strong>name of the S3 bucket</strong> where MLflow should store artifacts (models, metrics, etc.).</p>



<ul class="wp-block-list">
<li><code>&lt;your_registry_address&gt;/mlflow-server-ai-training:latest</code></li>
</ul>



<p>This is the<strong> custom MLflow Docker image</strong> you are running inside the job.</p>



<p><strong>2. Check if your AI Training job is RUNNING</strong></p>



<p>Replace the <code>&lt;job_id&gt;</code> by yours.</p>



<pre class="wp-block-code"><code class="">ovhai job get &lt;job_id&gt;</code></pre>



<p>You should obtain:</p>



<p><code>History:<br>    DATE                  STATE<br>    04-04-25 09:58:00     QUEUED<br>    04-04-25 09:58:01     INITIALIZING<br>    04-04-25 09:58:07     PENDING<br>    04-04-25 09:58:10     <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">RUNNING</mark></strong><br>  Info:<br>    Message:   Job is running</code></p>



<p><strong>3. Recover the IP and external IP of your AI Training job</strong></p>



<p>Using, your <code>&lt;job_id&gt;</code>, you can retrieve your AI Training <strong>job IP</strong>.</p>



<pre class="wp-block-code"><code class="">ovhai job get &lt;job_id&gt; -o json | jq '.status.ip' -r</code></pre>



<p>For example, you can obtain something like that: <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">10.42.80.176</mark></strong></p>



<p>You also need the External IP:</p>



<pre class="wp-block-code"><code class="">ovhai job get &lt;job_id&gt; -o json | jq '.status.externalIp' -r</code></pre>



<p>Returning the IP address you will have to whitelist to be able to connect to your database (e.g. <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><strong>51.210.38.188</strong></mark>)</p>



<h4 class="wp-block-heading">Step 6 – Whitelist AI Training job IP in PostgreSQL DB</h4>



<p>From <strong>Databases &amp; Analytics &gt; Databases</strong>, edit your DB configuration to <strong>allow access from the job Extranal IP</strong>.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="475" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-19-1024x475.png" alt="" class="wp-image-28593" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-19-1024x475.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-19-300x139.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-19-768x356.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-19-1536x712.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-19-2048x950.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Then, you can see that the job External IP is now white listed.</p>



<p>Well done! Your MLflow server and the backend store are now connected.</p>



<h4 class="wp-block-heading">Step 7 –  Create an AI Notebook</h4>



<p>It&#8217;s time to train and track your Machine Learning models using MLflow!</p>



<p>To do so, use the OVHcloud <code>ovhai</code> CLI and start a new AI Notebook with GPU.</p>



<pre class="wp-block-code"><code class="">ovhai notebook run conda jupyterlab \
  --name mlflow-notebook \
  --framework-version conda-py311-cudaDevel11.8 \
  --gpu 1</code></pre>



<p><em>Full command explained:</em></p>



<ul class="wp-block-list">
<li><code>ovhai noteb</code>ook<code> run</code></li>
</ul>



<p>This is the core command to <strong>run a notebook</strong> using the <strong>OVHcloud AI Notebooks</strong> platform.</p>



<ul class="wp-block-list">
<li><code>--name mlflow-notebook</code></li>
</ul>



<p>Sets a <strong>custom name</strong> for the notebook. In this case, you can name it <code>mlflow-notebook</code>.</p>



<ul class="wp-block-list">
<li><code>--framework-version conda-py311-cudaDevel11.8</code></li>
</ul>



<p>Define the framework and version you want to use in your notebook. Here, you are using Python 3.11 with Conda framework and CUDA compatibility.</p>



<ul class="wp-block-list">
<li><code>--gpu 1</code></li>
</ul>



<p>Allocates <strong>1 GPU</strong> for the job, by default a <strong>Tesla V100S</strong> from NVIDIA (<code>ai1-1-gpu</code>). You can select the flavor you want from the OVHcloud GPU range.</p>



<p>Then, check if your AI Notebook is RUNNING.</p>



<pre class="wp-block-code"><code class="">ovhai notebook get &lt;notebook_id&gt;</code></pre>



<p>Once your notebook is in RUNNING status, you should be able to access it using its URL:</p>



<p><code>State:          <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">RUNNING</mark></strong><br>Duration:       1411412   <br>Url:            <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">https://&lt;notebook_id&gt;.notebook.gra.ai.cloud.ovh.net</mark></strong><br>Grpc Address:   &lt;notebook_id&gt;.nb-grpc.gra.ai.cloud.ovh.net:443<br>Info Url:       https://ui.gra.ai.cloud.ovh.net/notebook/&lt;notebook_id&gt;</code></p>



<p>You can start your AI model development inside notebook.</p>



<h4 class="wp-block-heading">Step 8 – Model training inside Jupyter notebook</h4>



<p>To begin with, set up your notebook environment.</p>



<p><strong>1. Create the <code>requirements.txt</code> file</strong></p>



<pre class="wp-block-code"><code class="">numpy==2.2.3
scipy==1.15.2
mlflow==2.20.3
sklearn==1.6.1</code></pre>



<p><strong>2. Install dependencies</strong></p>



<p>From a notebook cell, launch the following command.</p>



<pre class="wp-block-code"><code class="">!pip3 install -r requirements.txt</code></pre>



<p>Perfect! You can start coding&#8230;</p>



<p><strong> 3. Import Python librairies</strong></p>



<p>Here, you have to import os, mlflow and scikit-learn.</p>



<pre class="wp-block-code"><code class=""># import dependencies
import os
import mlflow
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_diabetes
from sklearn.ensemble import RandomForestRegressor</code></pre>



<p>In another notebook cell, set the MLflow tracking URI. Note that you have to replace <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">10.42.80.176</mark></strong> by your own <strong>job IP</strong>.</p>



<pre class="wp-block-code"><code class="">mlflow.set_tracking_uri("http://<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">10.42.80.176</mark></strong>:5000")</code></pre>



<p>Then start training your model!</p>



<pre class="wp-block-code"><code class="">mlflow.autolog()

db = load_diabetes()
X_train, X_test, y_train, y_test = train_test_split(db.data, db.target)

# Create and train models.
rf = RandomForestRegressor(n_estimators=100, max_depth=6, max_features=3)
rf.fit(X_train, y_train)

# Use the model to make predictions on the test dataset.
predictions = rf.predict(X_test)</code></pre>



<p><strong>Output:</strong></p>



<p><code>🏃 View run dashing-foal-850 at: http://<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">10.42.80.176</mark></strong>:5000/#/experiments/0/runs/e7dad7c073634ec28675c0defce2b9ec </code><br><code>🧪 View experiment at: http://<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color">10.42.80.176</mark></strong>:5000/#/experiments/0</code></p>



<p>Congrats! You can now track your model training from<strong> MLflow remote server</strong>&#8230;</p>



<h4 class="wp-block-heading">Step 9 – Track and compare models from MLflow remote server</h4>



<p>Finally, access to MLflow dashboard using the job URL: <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-0-color"><code>https://&lt;job_id&gt;.job.gra.ai.cloud.ovh.net</code></mark></strong></p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="578" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-23-1024x578.png" alt="" class="wp-image-28598" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-23-1024x578.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-23-300x169.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-23-768x433.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-23-1536x867.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-23-2048x1155.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Then, you can check your model trainings and evaluations:</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="577" src="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-24-1024x577.png" alt="" class="wp-image-28599" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-24-1024x577.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-24-300x169.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-24-768x433.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-24-1536x866.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2025/04/image-24-2048x1154.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>What a success! You can finally use your MLflow to evaluate, compare and archive your various trainings.</p>



<h4 class="wp-block-heading">Step 10 &#8211; Monitor everything remotely</h4>



<p>You now have a complete Machine Learning pipeline with remote experiment tracking. Access:</p>



<ul class="wp-block-list">
<li><strong>Metrics, Parameters, and Tags</strong> → PostgreSQL</li>



<li><strong>Artifacts (Models, Files)</strong> → S3 bucket</li>
</ul>



<p>This setup is reusable, automatable, and production-ready!</p>



<h2 class="wp-block-heading">What’s next?</h2>



<ul class="wp-block-list">
<li>Automate deployment with <strong><a href="https://eu.api.ovh.com/" data-wpel-link="exclude">OVHcloud APIs</a></strong></li>



<li>Run different training sessions in parallel and compare them with your <strong>remote MLflow tracking server</strong></li>



<li>Use <strong><a href="https://www.ovhcloud.com/fr/public-cloud/ai-deploy/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">AI Deploy</a></strong> to serve your trained models</li>
</ul>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fmlflow-remote-tracking-server-ovhcloud-databases-object-storage-ai-solutions%2F&amp;action_name=Reference%20Architecture%3A%20set%20up%20MLflow%20Remote%20Tracking%20Server%20on%20OVHcloud&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Create your solution for Sign Language recognition with OVHcloud AI tools</title>
		<link>https://blog.ovhcloud.com/create-your-solution-for-sign-language-recognition-with-ovhcloud-ai-tools/</link>
		
		<dc:creator><![CDATA[Eléa Petton]]></dc:creator>
		<pubDate>Fri, 01 Sep 2023 09:27:49 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[AI Deploy]]></category>
		<category><![CDATA[AI Notebooks]]></category>
		<category><![CDATA[AI Training]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine learning]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=25709</guid>

					<description><![CDATA[A guide to build a solution for sign language interpretation based on a Computer Vision algorithm: YOLOv7. Introduction In the field of Artificial Intelligence, we often talk about Computer Vision and Object Detection, but what role do these AI techniques play in the vast field of healthcare? We&#8217;ll see that data plays a key role [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fcreate-your-solution-for-sign-language-recognition-with-ovhcloud-ai-tools%2F&amp;action_name=Create%20your%20solution%20for%20Sign%20Language%20recognition%20with%20OVHcloud%20AI%20tools&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p><em>A guide to build a solution for sign language interpretation based on a <strong>Computer Vision</strong> algorithm: <a href="https://github.com/WongKinYiu/yolov7" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">YOLOv7</a>.</em></p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="617" src="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.52-1024x617.png" alt="" class="wp-image-25717" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.52-1024x617.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.52-300x181.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.52-768x463.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.52-1536x925.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.52.png 1738w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Sign Language recognition with OVHcloud AI tools</em></figcaption></figure>



<h2 class="wp-block-heading">Introduction</h2>



<p>In the field of Artificial Intelligence, we often talk about <strong>Computer Vision</strong> and <strong>Object Detection</strong>, but what role do these AI techniques play in the vast field of healthcare? We&#8217;ll see that data plays a key role in AI applications for the medical-social sector. </p>



<p><strong>Have you ever wondered if AI could be the solution to understand sign language?</strong></p>



<p>Through this article, you will see that it is possible to use an AI model to detect signed letters. How? Thanks to the power of <strong>Computer Vision</strong> and <strong>Transfer Learning</strong>!</p>



<p><strong>The article is organized as follows:</strong></p>



<ul class="wp-block-list">
<li>Objectives</li>



<li>American Sign Language Dataset</li>



<li>Fine-Tune YOLOv7 model for Sign Language detection</li>



<li>Deploy custom YOLOv7 model for real time detection</li>
</ul>



<p><em>All the code for this blogpost is available in our dedicated <a href="https://github.com/ovh/ai-training-examples" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">G</a><a href="https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/object-detection/miniconda/yolov7/notebook_object_detection_yolov7_asl.ipynb" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">itHub repository</a>. You can <a href="https://help.ovhcloud.com/csm/en-gb-public-cloud-ai-notebooks-yolov7-sign-language?id=kb_article_view&amp;sysparm_article=KB0057517" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Fine-Tune YOLOv7</a> to detect signs with <strong>AI Notebooks</strong> tool and <a href="https://help.ovhcloud.com/csm/en-gb-public-cloud-ai-deploy-streamlit-yolov7-sign-language?id=kb_article_view&amp;sysparm_article=KB0057491" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">deploy the custom model</a> for real-time detection with <strong>AI Deploy</strong>.</em></p>



<h2 class="wp-block-heading">Objectives</h2>



<p>The purpose of this article is to show how it is possible to deploy a solution for <strong>Sign Language recognition</strong> thanks to AI. </p>



<p>An <strong>Object Detection</strong> algorithm will be used to detect the various signs and categorize them. Although closely related to image classification, <strong>Object Detection </strong>performs <strong>Image Classification</strong> on a more precise scale.</p>



<p>In this article, you will learn how to <strong><a href="https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/object-detection/miniconda/yolov7/notebook_object_detection_yolov7_asl.ipynb" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Fine-Tune YOLOv7</a></strong> model for <strong>Sign Language</strong> detection.</p>



<p>Once the model has been trained, what do you think of deploying a web app? <strong>Streamlit</strong> is the answer to your needs! At the end, AI will enable you to understand Sign Language, with <strong>real-time detection</strong> and written transcription.</p>



<h2 class="wp-block-heading">American Sign Language Dataset</h2>



<p>First of all, let&#8217;s talk data!</p>



<p><a href="https://public.roboflow.com/object-detection/american-sign-language-letters/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">American Sign Language Letters Dataset v1</a> is a public set of alphabet images and their labels created by <strong>David Lee</strong>.</p>



<p>This dataset is composed of <strong>1728 images</strong> and <strong>26 classes</strong> with the alphabet letters from A to Z.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<figure class="wp-block-image aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.00-1.png" alt="" class="wp-image-25725" style="width:377px;height:390px" width="377" height="390" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.00-1.png 935w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.00-1-290x300.png 290w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.00-1-768x794.png 768w" sizes="auto, (max-width: 377px) 100vw, 377px" /><figcaption class="wp-element-caption"><em>ASL dataset</em></figcaption></figure>
</div>
</div>



<p>This dataset is composed of <strong>images</strong> and their corresponding <strong>labels</strong>, which are in <strong>txt</strong> format and give information about the location of the object thanks to the <em>x</em>, <em>y</em> coordinates as well as the <em>height</em> and <em>width</em> of the bounding box.</p>



<figure class="wp-block-image aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2022/01/mug_annotation-1024x635.png" alt="" class="wp-image-21645" style="width:1024px;height:635px" width="1024" height="635" srcset="https://blog.ovhcloud.com/wp-content/uploads/2022/01/mug_annotation-1024x635.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2022/01/mug_annotation-300x186.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2022/01/mug_annotation-768x477.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2022/01/mug_annotation-1536x953.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2022/01/mug_annotation.png 1713w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Label components of the ASL dataset for YOLOv7 usage</em></figcaption></figure>



<p>This data format is ideal for training a <strong>YOLO</strong> type Object Detection model.</p>



<h2 class="wp-block-heading">Fine-Tune YOLOv7 model for Sign Language recognition</h2>



<p>How can the model YOLOv7 be trained to recognize American Sign Language letters? </p>



<h6 class="wp-block-heading"><strong>Object Detection with YOLOv7 </strong></h6>



<p><strong>YOLOv7</strong> is part of the &#8220;YOLO family&#8221; algorithms, which actually means &#8220;<em>You Only Look Once</em>.&#8221; In fact, unlike many detection algorithms, YOLO is a neural network that evaluates the position and class of identified objects from a <strong>single end-to-end network</strong> that detects classes using a fully connected layer.</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.02.47-1024x991.png" alt="" class="wp-image-25722" style="width:533px;height:515px" width="533" height="515" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.02.47-1024x991.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.02.47-300x290.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.02.47-768x743.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.02.47.png 1059w" sizes="auto, (max-width: 533px) 100vw, 533px" /><figcaption class="wp-element-caption"><em>Object Detection</em></figcaption></figure>



<p>Therefore, YOLO models pass only once on each image to detect the objects. This Object Detection model is particularly known for its <strong>speed</strong> and <strong>accuracy</strong> and allows <strong>real-time recognition</strong>.</p>



<p>But how can the model YOLOv7 be trained to recognize American Sign Language letters? Follow the next steps and let the magic work!</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="266" src="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.27-1024x266.png" alt="" class="wp-image-25719" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.27-1024x266.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.27-300x78.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.27-768x200.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.27-1536x400.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-11.23.27.png 1841w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Fine-Tuning of YOLOv7</em></figcaption></figure>



<p><em>The full notebook is available on the following <a href="https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/object-detection/miniconda/yolov7/notebook_object_detection_yolov7_asl.ipynb" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">GitHub repository</a>.</em></p>



<h4 class="wp-block-heading">Import dependencies</h4>



<p>Firstly, import the dependencies you need.</p>



<pre class="wp-block-code"><code class="">import torch
import os
import yaml
import torchvision
from IPython.display import Image, clear_output</code></pre>



<h4 class="wp-block-heading">Check GPU availability</h4>



<p>Then, check the GPU availability. Indeed, the training of a model like YOLOv7 requires the use of <strong>GPU</strong>, in this case a Tesla V100S is used.</p>



<pre class="wp-block-code"><code class="">print('Setup complete. Using torch %s %s' % (torch.__version__, torch.cuda.get_device_properties(0) if torch.cuda.is_available() else 'CPU'))</code></pre>



<p><code>Setup complete. Using torch 1.12.1+cu102 _CudaDeviceProperties(name='Tesla V100S-PCIE-32GB', major=7, minor=0, total_memory=32510MB, multi_processor_count=80)</code></p>



<h4 class="wp-block-heading">Extract the dataset information</h4>



<p>Next, you can access to the <code>data.yaml</code> file.</p>



<p>This file contains vital information about the dataset, especially the number of classes. Here we got 26 classes with the letters from A to Z.</p>



<pre class="wp-block-code"><code class=""># go to the directory where the data.yaml file is located to extract the number of classes
%cd /workspace/data
with open("data.yaml", 'r') as stream:
    num_classes = str(yaml.safe_load(stream)['nc'])</code></pre>



<p>Now, it&#8217;s time to train YOLOv7 model!</p>



<h4 class="wp-block-heading">Recover YOLOv7 weights</h4>



<p>In this tutorial, you can use the&nbsp;<strong>Transfer Learning</strong>&nbsp;method by using YOLOv7 weights pre-trained on the&nbsp;<a href="https://cocodataset.org/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">COCO dataset</a>.</p>



<p><strong>How to define Transfer Learning?</strong></p>



<p>For both humans and machines, learning something new takes time and practice. However, it is easier to perform out tasks similar to those already learned. As with humans, AI will be able to identify patterns from previous knowledge and apply them to new learning.</p>



<p>If a model is trained on a database, there is no need to re-train the model from scratch to fit a new set of similar data.</p>



<p><strong>Main advantages of Transfer Learning:</strong></p>



<ul class="wp-block-list">
<li>saving resources</li>



<li>improving efficiency</li>



<li>model training facilitation</li>



<li>saving time</li>
</ul>



<p>At this time, you can download the trained model:</p>



<pre class="wp-block-code"><code class=""># YOLOv7 path
%cd /workspace/yolov7
!wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7_training.pt</code></pre>



<p><code>Saving to: ‘yolov7_training.pt’<br>yolov7_training.pt 100%[===================&gt;] 72.12M 12.0MB/s in 5.5s</code></p>



<h4 class="wp-block-heading">Run YOLOv7 training on ASL Letters Dataset</h4>



<p>You can therefore set the following parameters.</p>



<ul class="wp-block-list">
<li><em><strong>workers:</strong></em> maximum number of dataloader workers.</li>



<li><em><strong>device:</strong></em> cuda device.</li>



<li><strong><em>batch-size:</em></strong> refers to the batch size (number of training examples used in one iteration).</li>



<li><strong><em>data:</em></strong> refers to the path to the yaml file.</li>



<li><strong><em>img:</em></strong> refers to the input images size.</li>



<li><strong><em>cfg:</em></strong> define the model configuration.</li>



<li><strong><em>weights:</em></strong> initial weights path.</li>



<li><strong><em>name:</em></strong> save to project/name.</li>



<li><strong><em>hyp:</em></strong> hyperparameters path.</li>



<li><strong><em>epochs:</em></strong> refers to the number of training epochs. An epoch corresponds to one cycle through the full training dataset.</li>
</ul>



<pre class="wp-block-code"><code class=""># time the performance
%time

# train yolov7 on custom data for 100 epochs
!python /workspace/yolov7/train.py \
          --workers 8 \
          --device 0 \
          --batch-size 8 \
          --data '/workspace/data/data.yaml' \
          --img 416 416 \
          --cfg '/workspace/yolov7/cfg/training/yolov7.yaml' \
          --weights '/workspace/yolov7/yolov7_training.pt' \
          --name yolov7-asl \
          --hyp '/workspace/yolov7/data/hyp.scratch.custom.yaml' \
          --epochs 100</code></pre>



<h4 class="wp-block-heading">Display results of YOLOv7 training on ASL Letters dataset</h4>



<p>Then you can display the results of the training and check the evolution of the metrics.</p>



<pre class="wp-block-code"><code class=""># display images
Image(filename='/workspace/yolov7/runs/train/yolov7-asl/results.png', width=1000)  # view results</code></pre>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="512" src="https://blog.ovhcloud.com/wp-content/uploads/2023/08/image-1024x512.png" alt="" class="wp-image-25713" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/08/image-1024x512.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/image-300x150.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/image-768x384.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/image-1536x768.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/image-2048x1024.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>YOLOv7 training overview</em></figcaption></figure>



<h4 class="wp-block-heading">Export new weights for future inference</h4>



<p>Finally, you can extract the <strong>new weights</strong> coming from YOLOv7 training on ASL Alphabet dataset. The goal is to save the model weights in a bucket in the cloud for reuse in a dedicated application.</p>



<p>Firstly, rename the PyTorch model it with the name you want.</p>



<pre class="wp-block-code"><code class="">%cd /workspace/yolov7/runs/train/yolov7-asl/weights/
os.rename("best.pt","yolov7.pt")</code></pre>



<p><code>/workspace/yolov7/runs/train/yolov7-asl/weights</code></p>



<p>Secondly, copy it in a new folder where you can put all the weights generated during your trainings.</p>



<pre class="wp-block-code"><code class="">%cp /workspace/yolov7/runs/train/yolov7-asl/weights/yolov7.pt /workspace/asl-volov7-model/yolov7.pt</code></pre>



<p><strong>Your model is ready?</strong> It&#8217;s now time to deploy a web app to use the model and benefit from real-time detection 🎉 !</p>



<h2 class="wp-block-heading">Deploy custom YOLOv7 model for real time detection</h2>



<p>Once this <strong>YOLOv7 model</strong> is trained, it can be used for inference. If you want to quickly build an app to serve your AI model, the <strong>Streamlit</strong> framework may be right for you.</p>



<h6 class="wp-block-heading"><strong>What is Streamlit?</strong></h6>



<p>Now, it&#8217;s time to discuss about the framework used to create a Web App: <strong>Streamlit</strong>!</p>



<p><a href="https://streamlit.io/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">Streamlit</a>&nbsp;allows you to transform data scripts into quickly shareable web applications using only the&nbsp;<strong>Python</strong>&nbsp;language. Moreover, this framework does not require front-end skills.</p>



<p>This is a time-saver for the data scientist who wants to deploy an app around the world of data!</p>



<p>To make this app accessible, you need to containerize it using&nbsp;<strong>Docker</strong>.</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.00.50-1024x960.png" alt="" class="wp-image-25723" style="width:601px;height:564px" width="601" height="564" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.00.50-1024x960.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.00.50-300x281.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.00.50-768x720.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/Capture-decran-2023-08-28-a-14.00.50.png 1098w" sizes="auto, (max-width: 601px) 100vw, 601px" /><figcaption class="wp-element-caption"><em>Streamlit web app</em></figcaption></figure>



<p>By creating an app, you will enable anyone to <strong>understand Sign Language</strong>, with Real-Time detection and written transcription.</p>



<p>Let&#8217;s go for the implementation!</p>



<h4 class="wp-block-heading">Create the interface with Streamlit</h4>



<p>First of all, we must build the <strong>web interface</strong> to take a photo and the various functions to analyze the signs present on this image.</p>



<ul class="wp-block-list">
<li><code>load_model</code>: this function should be pushed in &#8220;cache&#8221; so that you only have to load the model once</li>
</ul>



<pre class="wp-block-code"><code class="">@st.cache
def load_model():

    custom_yolov7_model = torch.hub.load("WongKinYiu/yolov7", 'custom', '/workspace/asl-volov7-model/yolov7.pt')

    return custom_yolov7_model</code></pre>



<ul class="wp-block-list">
<li><code>get_prediction</code>: the model analyzes the image and returns the result of the prediction</li>
</ul>



<pre class="wp-block-code"><code class="">def get_prediction(img_bytes, model):

    img = Image.open(io.BytesIO(img_bytes))
    results = model(img, size=640)

    return results</code></pre>



<ul class="wp-block-list">
<li><code>analyse_image</code>: the image is processed before and after the model analysis</li>
</ul>



<pre class="wp-block-code"><code class="">def analyse_image(image, model):

    if image is not None:

        img = Image.open(image)

        bytes_data = image.getvalue()
        img_bytes = np.asarray(bytearray(bytes_data), dtype=np.uint8)
        result = get_prediction(img_bytes, model)
        result.render()

        for img in result.imgs:
            RGB_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
            im_arr = cv2.imencode('.jpg', RGB_img)[1]
            st.image(im_arr.tobytes())

        result_list = list((result.pandas().xyxy[0])["name"])

    else:
        st.write("no asl letters were detected!")
        result_list = []

    return result_list</code></pre>



<ul class="wp-block-list">
<li><code>display_letters</code>: the letters are recovered and displayed to form the final word</li>
</ul>



<pre class="wp-block-code"><code class="">def display_letters(letters_list):

    word = ''.join(letters_list)
    path_file = "/workspace/word_file.txt"
    with open(path_file, "a") as f:
        f.write(word)

    return path_file</code></pre>



<p><em>To access the full code of the app, refer to this <a href="https://github.com/ovh/ai-training-examples/tree/main/apps/streamlit/sign-language-recognition-yolov7-app" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">GitHub</a><a href="https://github.com/ovh/ai-training-examples/blob/main/apps/streamlit/sign-language-recognition-yolov7-app/main.py" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer"> repository</a>.</em></p>



<h4 class="wp-block-heading">Containerize your app with Docker</h4>



<p>Once the app code has been created, it&#8217;s time to containerize it!</p>



<p>The containerization is based on the construction of a Docker image, and before this image is usable, several steps must be completed.</p>



<p><strong>What are the containerization steps 🐳 ?</strong></p>



<p><em>The following steps refer to this <a href="https://help.ovhcloud.com/csm/en-gb-public-cloud-ai-deploy-streamlit-yolov7-sign-language?id=kb_article_view&amp;sysparm_article=KB0057491" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">documentation</a> where you can find detailed information.</em></p>



<ul class="wp-block-list">
<li>Write the <a href="https://github.com/ovh/ai-training-examples/blob/main/apps/streamlit/sign-language-recognition-yolov7-app/requirements.txt" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">requirements.txt</a> file</li>



<li>Create the <a href="https://github.com/ovh/ai-training-examples/blob/main/apps/streamlit/sign-language-recognition-yolov7-app/Dockerfile" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Dockerfile</a></li>



<li><a href="https://help.ovhcloud.com/csm/fr-public-cloud-ai-deploy-streamlit-yolov7-sign-language?id=kb_article_view&amp;sysparm_article=KB0057495#build-the-docker-image-from-the-dockerfile" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Build the Docker image</a></li>



<li><a href="https://help.ovhcloud.com/csm/fr-public-cloud-ai-deploy-streamlit-yolov7-sign-language?id=kb_article_view&amp;sysparm_article=KB0057495#push-the-image-into-the-shared-registry" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Tag and push the Docker image on a registry</a></li>
</ul>



<p>Your docker image is created successfully? You are ready to launch your app 🚀 !</p>



<h4 class="wp-block-heading">Deploy your app and make it accessible</h4>



<p>The following command starts a new AI Deploy app running your Streamlit web interface.</p>



<pre class="wp-block-code"><code class="">ovhai app run
       --gpu 1 \
       --default-http-port 8501 \
       --volume asl-volov7-model@GRA/:/workspace/asl-volov7-model:RO \
       &lt;shared-registry-address&gt;/yolov7-streamlit-asl-recognition:latest</code></pre>



<p>In this command line, you can set up several parameters:</p>



<ul class="wp-block-list">
<li><code>resources</code>: choose between CPUs or GPUs</li>



<li><code>default HTTP port</code>: precise the Streamlit default port &#8211; 8501</li>



<li><code>data</code>: link the bucket containing your model</li>



<li><code>docker image</code>: add your docker image addess</li>
</ul>



<p>When your app is up and running, you can access the following page:</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="648" height="1024" src="https://blog.ovhcloud.com/wp-content/uploads/2023/08/overview-streamlit-yolov7-asl-648x1024.png" alt="" class="wp-image-25720" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/08/overview-streamlit-yolov7-asl-648x1024.png 648w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/overview-streamlit-yolov7-asl-190x300.png 190w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/overview-streamlit-yolov7-asl-768x1214.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/overview-streamlit-yolov7-asl-972x1536.png 972w, https://blog.ovhcloud.com/wp-content/uploads/2023/08/overview-streamlit-yolov7-asl.png 988w" sizes="auto, (max-width: 648px) 100vw, 648px" /><figcaption class="wp-element-caption"><em>Resulting Streamlit app</em></figcaption></figure>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Well done 🎉&nbsp;! You have learned how to create <strong>your own solution for Sign Language recognition</strong> with OVHcloud AI tools.</p>



<p>You have been able to <strong>Fine-Tune YOLOv7 model</strong> thanks to <em>AI Notebooks</em> and <strong>deploy a Real-Time recognition app</strong> with <em>AI Deploy</em>.</p>



<h4 class="wp-block-heading" id="want-to-find-out-more">Want to find out more?</h4>



<h6 class="wp-block-heading"><strong>Notebook</strong></h6>



<p>You want to access the notebook? Refer to the&nbsp;<a href="https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/object-detection/miniconda/yolov7/notebook_object_detection_yolov7_asl.ipynb" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">GitHub repository</a>.</p>



<p>To launch this notebook with&nbsp;<strong>AI Notebook</strong>, please refer to&nbsp;our&nbsp;<a href="https://help.ovhcloud.com/csm/en-gb-public-cloud-ai-notebooks-yolov7-sign-language?id=kb_article_view&amp;sysparm_article=KB0057517" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">documentation</a>.</p>



<h6 class="wp-block-heading"><strong>App</strong></h6>



<p>You want to access to the full code to create the Streamlit app? Refer to the&nbsp;<a href="https://github.com/ovh/ai-training-examples/tree/main/apps/streamlit/sign-language-recognition-yolov7-app" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">GitHub repository</a>.<br><br>To deploy this app with&nbsp;<strong>AI Deploy</strong>, please refer to&nbsp;our&nbsp;<a href="https://help.ovhcloud.com/csm/en-gb-public-cloud-ai-deploy-streamlit-yolov7-sign-language?id=kb_article_view&amp;sysparm_article=KB0057491" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">doc</a><a href="https://docs.ovh.com/gb/en/publiccloud/ai/deploy/tuto-streamlit-eda-iris/" data-wpel-link="exclude">umentation</a>.</p>



<h2 class="wp-block-heading">References</h2>



<ul class="wp-block-list">
<li><a href="https://public.roboflow.com/object-detection/american-sign-language-letters" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">ASL Alphabet Dataset V1</a></li>



<li><a href="https://github.com/WongKinYiu/yolov7" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">YOLOv7 GitHub repository</a></li>



<li><a href="https://blog.ovhcloud.com/object-detection-train-yolov5-on-a-custom-dataset/" data-wpel-link="internal">Object detection: train YOLOv5 on a custom dataset</a></li>



<li><a href="https://medium.com/@prishanga1/yolov7-training-on-custom-data-c6d8ec030e13" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">YoloV7 Training on Custom Data</a></li>
</ul>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fcreate-your-solution-for-sign-language-recognition-with-ovhcloud-ai-tools%2F&amp;action_name=Create%20your%20solution%20for%20Sign%20Language%20recognition%20with%20OVHcloud%20AI%20tools&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
