Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Cohere ai Cohere python WandbConfig

From Leeroopedia
Knowledge Sources
Domains SDK, Fine_Tuning
Last Updated 2026-02-15 14:00 GMT

Overview

The WandbConfig class provides configuration for Weights & Biases integration during Cohere fine-tuning operations.

Description

WandbConfig is a Pydantic-based data class that holds the settings needed to connect a fine-tuning job to Weights & Biases (W&B) for experiment tracking and logging. It requires a project name and API key, and optionally accepts an entity name to associate the run with a specific W&B team or user. The class extends UncheckedBaseModel and supports both Pydantic v1 and v2 configurations.

Usage

Use this class when you want to enable Weights & Biases logging for a fine-tuning job. Pass a WandbConfig instance as part of the fine-tuning configuration to have training metrics, hyperparameters, and other run metadata automatically logged to your W&B dashboard.

Code Reference

Source Location

  • Repository: Cohere Python SDK
  • File: src/cohere/finetuning/finetuning/types/wandb_config.py

Signature

class WandbConfig(UncheckedBaseModel):
    """
    The Weights & Biases configuration.
    """

    project: str = pydantic.Field()
    api_key: str = pydantic.Field()
    entity: typing.Optional[str] = pydantic.Field(default=None)

Import

from cohere.finetuning.finetuning.types import WandbConfig

I/O Contract

Fields

Field Type Required Default Description
project str Yes (none) The W&B project name to be used during training.
api_key str Yes (none) The W&B API key to be used during training.
entity typing.Optional[str] No None The W&B entity name (team or user) to be used during training.

Usage Examples

Minimal configuration with required fields

from cohere.finetuning.finetuning.types import WandbConfig

wandb_config = WandbConfig(
    project="cohere-finetune-experiment",
    api_key="your-wandb-api-key",
)

print(wandb_config.project)  # "cohere-finetune-experiment"
print(wandb_config.entity)   # None

Full configuration with entity

from cohere.finetuning.finetuning.types import WandbConfig

wandb_config = WandbConfig(
    project="cohere-finetune-experiment",
    api_key="your-wandb-api-key",
    entity="my-team",
)

print(wandb_config.project)  # "cohere-finetune-experiment"
print(wandb_config.api_key)  # "your-wandb-api-key"
print(wandb_config.entity)   # "my-team"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment