comet-ml
БесплатноБез исполняемых скриптовНе проверенComet ML is a platform for tracking machine learning experiments, managing registered models, and comparing runs. Use when logging experiments…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Comet ML — ML Experiment Tracking & Model Management
Overview
Comet ML is a platform for tracking machine learning experiments (parameters, metrics, code, git state, environment), registering model versions, and comparing runs through the Python SDK comet-ml and its REST-backed API class. LLM tracing and evaluation are handled by the separate Opik package.
Instructions
Experiment Tracking
# train.py — Track a training run with Comet ML
import os
import comet_ml # import before torch/sklearn so auto-logging can hook them
from comet_ml import Experiment
import torch
from torch import nn, optim
# Initialize experiment — auto-logs git info, environment, and dependencies
experiment = Experiment(
api_key=os.environ["COMET_API_KEY"],
project_name="text-classifier",
workspace="my-team",
auto_metric_logging=True,
auto_param_logging=True,
auto_histogram_weight_logging=True,
log_code=True, # Logs the full source code
)
# Log hyperparameters
experiment.log_parameters({
"model": "distilbert-base-uncased",
"learning_rate": 2e-5,
"batch_size": 32,
"epochs": 5,
"optimizer": "AdamW",
"warmup_steps": 100,
"weight_decay": 0.01,
"max_seq_length": 256,
})
# Log dataset information
experiment.log_dataset_hash(train_df) # Hash for reproducibility
experiment.log_parameter("train_samples", len(train_df))
experiment.log_parameter("val_samples", len(val_df))
# Training loop with metric logging
for epoch in range(5):
model.train()
running_loss = 0
for batch_idx, (inputs, labels) in enumerate(train_loader):
optimizer.zero_grad()
outputs = model(inputs)
loss = criterion(outputs, labels)
loss.backward()
optimizer.step()
running_loss += loss.item()
# Log batch-level metrics
experiment.log_metric("batch_loss", loss.item(),
step=epoch * len(train_loader) + batch_idx)
# Log epoch-level metrics
avg_loss = running_loss / len(train_loader)
experiment.log_metric("train_loss", avg_loss, epoch=epoch)
# Validation
val_loss, val_acc, val_f1 = evaluate(model, val_loader)
experiment.log_metrics({
"val_loss": val_loss,
"val_accuracy": val_acc,
"val_f1": val_f1,
}, epoch=epoch)
print(f"Epoch {epoch}: loss={avg_loss:.4f} val_acc={val_acc:.4f}")
# Log the weights, so they can be registered later
experiment.log_model("text-classifier", "./model_weights.pt")
# Log confusion matrix
experiment.log_confusion_matrix(
y_true=val_labels,
y_predicted=val_predictions,
labels=["negative", "neutral", "positive"],
)
# Log sample predictions
for i in range(10):
experiment.log_text(f"Input: {val_texts[i]}\nPredicted: {val_predictions[i]}\nActual: {val_labels[i]}")
# Add tags for filtering in the dashboard
experiment.add_tags(["v2", "distilbert", "sentiment"])
experiment.end()
Model Registry
# In train.py, after log_model and before experiment.end(): register the logged model
# The first argument is the name given to log_model; registry_name is the registered model's name
experiment.register_model(
"text-classifier",
registry_name="text-classifier-prod",
version="1.2.0",
description="DistilBERT fine-tuned on customer reviews, F1=0.92",
tags=["production-ready"],
status="Production", # free-form status string, e.g. Staging | Production
)
# Later, from another script: look up, promote and download a registered model
import os
from comet_ml import API
api = API(api_key=os.environ["COMET_API_KEY"])
model = api.get_model(workspace="my-team", model_name="text-classifier-prod")
details = model.get_details("1.2.0")
print(details["modelName"], details["version"], details["status"])
model.set_status("1.2.0", "Production")
model.download("1.2.0", output_folder="./model_artifacts/")
LLM Tracking (Opik)
Comet's LLM tracing, prompt and evaluation features live in Opik, a separate open-source package (pip install opik) that can run on Comet cloud or be self-hosted. The comet-ml SDK has no OpenAI integration.
import opik
from openai import OpenAI
from opik.integrations.openai import track_openai
opik.configure() # prompts for / reads the Opik API key and URL
client = track_openai(OpenAI(), project_name="support-bot-eval")
reply = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Summarize our refund policy in two sentences."}],
)
# Prompt, response, model, token usage and latency show up as a trace in Opik
@opik.track # trace any function as a span
def answer(question: str) -> str:
return client.chat.completions.create(
model="gpt-4o-mini", messages=[{"role": "user", "content": question}]
).choices[0].message.content
Comparing Experiments
Установить comet-ml в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл comet-ml?
Comet ML is a platform for tracking machine learning experiments, managing registered models, and comparing runs. Use when logging experiments, hyperparameters and metrics, registering model versions, or comparing training runs; LLM tracing goes through Comet's Opik. Helps developers log experiments, compare model versions, and build reproducible ML pipelines with automatic code/data versioning.
Как установить скилл comet-ml?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл comet-ml запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic