spacy-loggers

Training-run loggers for spaCy: Weights & Biases, MLflow, ClearML, PyTorch, CuPy

Library
PyPI
v1.0.5
12stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
27/100Needs Attention
Development Activity0
Maintenance20
Community20
Maturity56
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
61/100Good
Architecture68
Code Quality66
Innovation50
Learning Curve58

spacy-loggers provides the alternate training loggers that spaCy split out of its core package starting with v3.2, so integrations with experiment-tracking tools can be added, updated, and released independently of spaCy itself. It ships ready-made loggers for Weights & Biases, MLflow, and ClearML that stream training metrics, losses, and the full interpolated config to each tool’s dashboard, plus PyTorch and CuPy loggers for lower-level framework instrumentation.

Each logger is registered as a spaCy config component (e.g. spacy.WandbLogger.v5) and is selected declaratively in the [training.logger] section of a spaCy training config rather than wired up in Python code. A ChainLogger utility lets multiple loggers run side by side — for example sending output to both the console and an experiment tracker in the same training run — and each logger exposes a remove_config_values option to strip sensitive path or credential fields from the config before it’s uploaded to a third-party dashboard.

What You Get

  • spacy.WandbLogger.vN - streams training metrics, system stats, and the full config to a Weights & Biases dashboard, with optional model-checkpoint and dataset artifact logging
  • spacy.MLflowLogger.vN - logs config as MLflow run parameters and per-step scores/losses as MLflow metrics, uploading the best model artifact when the score improves
  • spacy.ClearMLLogger.vN - sends config, git commit info, console output, and scalar plots to a ClearML server (hosted or self-hosted)
  • PyTorch and CuPy loggers for framework-level training instrumentation
  • ChainLogger utility to run multiple loggers together in a single training run (e.g. console + Weights & Biases simultaneously)
  • remove_config_values option on each logger to exclude sensitive fields (file paths, credentials) from what gets uploaded to third-party dashboards

Common Use Cases

  • Tracking spaCy NLP model training runs on a Weights & Biases dashboard for experiment comparison and hyperparameter tuning
  • Logging spaCy training metrics and model artifacts to a team’s self-hosted MLflow tracking server
  • Sending spaCy training runs to ClearML for full reproducibility (config, code state, console output, and scalars) alongside other ML experiments
  • Combining console output with a remote experiment tracker in the same training run via ChainLogger

Under The Hood

Architecture - each integration lives in its own module (wandb.py, mlflow.py, clearml.py, pytorch.py, cupy.py) implementing spaCy’s logger protocol (a callable returning a (log_step, finalize) pair), registered under versioned names like spacy.WandbLogger.v5 via spaCy/Thinc’s function registry so training configs select a logger purely by name; chain.py composes several logger callables into one that fans out each logging call. Tech Stack - pure Python with each third-party integration (wandb, mlflow, clearml, torch) treated as an optional dependency the user installs separately rather than a hard requirement of spacy-loggers itself. Code Quality - a spacy_loggers/tests/ directory covers the registered loggers; the package has been feature-stable with no commits since late 2023, consistent with its role as a narrow, infrequently-changing integration layer split out specifically so it wouldn’t need to track spaCy’s own release cadence. API Design - loggers are configured declaratively in .cfg/.ini training config files (@loggers = "spacy.WandbLogger.v5" plus keyword parameters), not instantiated directly in Python, keeping the integration surface config-driven and consistent with the rest of spaCy’s config-first architecture.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search