Fine-tuning Command R just got easier: Introducing the Cohere and W&B Models integration
What you need to know about our latest integration with Cohere
Created on October 3|Last edited on October 3
Comment
We’re thrilled to unveil a seamless integration between W&B Models and the Cohere fine-tuning API. This collaboration makes fine-tuning Cohere's family of Command R large language models (LLMs) more straightforward and boosts your accuracy without the usual headaches.
The reason to fine-tune LLMs
Cohere’s chat models, including Command R and Command R+, are exceptionally capable straight out of the box, handling a wide range of general tasks with ease. But fine-tuning offers a powerful way to customize their performance and take these models to the next level for specific applications.
Fine-tuning lets you adjust some of the model weights, specializing it for your unique tasks. This leads to higher accuracy and better results tailored precisely to your needs. Fine-tuning LLMs is an iterative dance of tweaking hyperparameters, adjusting your training dataset, and striving to minimize both training and validation loss. This process can be time-consuming and complex, often requiring you to manually track experiments and sift through results to find what works.
Streamlined fine-tuning with the W&B Models integration
Our latest integration with the Cohere fine-tuning API streamlines this lifecycle.
Imagine starting your experiment tracking with just one line of code in your Cohere API call. No more juggling separate tracking systems or manually logging metrics. The integration takes care of it all, automatically logging key metrics like training and validation loss, as well as accuracy, straight into your W&B Models workspace. This real-time monitoring means you can analyze results on the fly, speeding up your iteration cycles.
from cohere.finetuning import WandbConfig, FinetunedModelwandb_ft_config = WandbConfig(api_key="<wandb_api_key>",entity="my-entity",project="cohere-ft")...# start a fine-tuning run on coherecmd_r_finetune = co.finetuning.create_finetuned_model(request=FinetunedModel(name="cfqa-command-r-ft",settings=Settings(base_model=...dataset_id=...hyperparameters=...wandb=wandb_ft_config # pass your W&B config here),),)
Visualization and comparison of runs is a breeze with W&B Models. Easily compare different runs based on accuracy, loss, and other metrics to quickly identify the top-performing models and their optimal hyperparameters. This makes spotting the best configurations faster and more intuitive.
Overfitting is a common pitfall in fine-tuning, but this new integration makes it easy to identify and address it. Parameter importance charts and customizable line plots within W&B Models let you scrutinize your fine-tuning runs for signs of overfitting and then adjust your hyperparameters or training data as needed to avoid it.

Another benefit to the integration is real-time insights. You’ll automatically log key metrics like train/validation loss and accuracy directly into your W&B Models workspace. This real-time monitoring eliminates the need to wait for jobs to finish before analyzing results, enabling faster iteration cycles and accelerating your workflow.
Maintaining a centralized record of your fine-tuning efforts is crucial. Our integration makes this possible. Track the lineage between your original experiments and fine-tuned models—along with all associated metrics—inside your W&B Models workspace. This centralized system not only enhances reproducibility but also helps you meet governance and audit requirements effortlessly.
This centralized system of record makes collaboration easy. Teams can share experiment results and insights effortlessly, enabling collective iteration on model development. This collaborative approach breaks down silos and accelerates your ML projects, keeping your whole team on the same page.
Getting started is easy
Jumping into this integration is straightforward. Just specify your W&B configuration directly in your Cohere fine-tuning API call and the integration handles the rest. Once your fine-tuning job kicks off, navigate to your designated project in the W&B Models workspace.
There, you’ll find automatically generated panels displaying various metrics, including parameter importance charts and line plots. These panels are customizable, allowing you to focus on specific areas like overfitting by comparing training and validation loss curves. Dive into the data, compare different runs, and pinpoint the best-performing model versions and their corresponding hyperparameters with ease.
To get started, follow along with the Cohere fine-tuning cookbook. For more information on the integration, see the Cohere API documentation and the W&B Models developer guide.
Conclusion
The new W&B Models integration with the Cohere fine-tuning API is a powerful tool for developers looking to streamline their Command R fine-tuning process.
By providing deeper insights into model performance and simplifying experiment tracking and collaboration, this integration helps you achieve better accuracy tailored to your specific use cases—all while saving time and reducing complexity. Enhance your fine-tuning workflow and push the boundaries of what your Command R models can achieve with this new integration.
Add a comment
Iterate on AI agents and models faster. Try Weights & Biases today.