DavidGadyan

AI & Agents · Cloud, DevOps & LLMOps

Multilingual Text Generation: Mistral 7B Fine-Tuning & API

By David Gadyan · Published · Updated · Client: Rostislav Pankratov

Mistral AI logo beside a large pixelated orange number seven on white

Fine-tuned open-source Mistral 7B with HuggingFace and LangChain so a content client could paraphrase multilingual material that hosted models refuse, then served the model as a FastAPI REST API on rented GPUs across Paperspace, DigitalOcean, Kaggle and GCP. The first contract's results led to two follow-on serving and deployment contracts.

The problem

The client needed to paraphrase specific content for specific resources, in more than one language, at a volume that only automation made practical. Hosted assistants such as ChatGPT refused parts of the material because of their content restrictions, so the work could not simply be sent to a third-party API. What was needed was a model the client controlled: fine-tuned for the paraphrasing task and served from infrastructure they chose.

What I built

  • A fine-tuned Mistral 7B, the open-source model, trained with HuggingFace and orchestrated with LangChain, specialised for the client's multilingual paraphrasing.
  • A FastAPI REST API that wraps the model so the client's own systems call it like any other service.
  • Deployment onto rented GPU machines from Paperspace, DigitalOcean, Kaggle and GCP GPU VMs, so the client pays for GPU time rather than owning hardware.
  • Python end to end, from the training scripts to the serving code.

How it was delivered

The work ran across three contracts. The first covered fine-tuning Mistral 7B and evaluating its output; once the results proved out, two further contracts covered building the REST API and deploying it on rented GPU infrastructure. I was the sole engineer on all three.

Outcome

A client-owned Mistral 7B that paraphrases multilingual content hosted models would not handle, exposed as a FastAPI service on rented GPUs. The results of the first fine-tuning contract were strong enough that the engagement extended into two more, taking the model from an experiment to a deployed API.

Related projects

← All projects