Skip to content

[Usability]: Please pin the exact version of tokenizers and other fast-moving libraries it depends on #8581

@prrao87

Description

@prrao87

What happened?

This morning, an update to the Hugging Face tokenizers library caused a breaking change to all DSPy users, because DSPy pulls the latest tokenizers version. I was able to bypass this issue by downgrading the version of tokenizers myself, but this took a lot of time to dig through the issues and find that downgrading the tokenizers library would solve the problem.

dependencies = [
    "dspy>=3.0.0b3",
    "tokenizers==0.21.2",
]

This is imo a little too lax, and introduced unintended breaking points because tokenizers is a fast-moving project and can introduce breaking changes like this, this totally breaks DSPy installs too, causing unnecessary headaches for users. Because Tokenizers is not a critical dependency for DSPy (not every user needs it and is even aware it's being installed under the hood), and because DSPy itself moves at a rapid pace, it's worth pinning the non-critical deps like this so that such annoying breaking changes upstream don't block newcomers to DSPy who are still learning the ropes.

Steps to reproduce

uv add dspy

This is broken and fails to work (as of 5 pm UTC on 28 July 2025).

DSPy version

3.0.0b3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions