Skip to content

Conversation

@CodeWithKyrian
Copy link
Owner

Summary

  • Replace custom HubLoader HTTP+cache logic with the codewithkyrian/huggingface Hub client.
  • Adopt snapshot+manifest-based caching for tokenizer.json and tokenizer_config.json to avoid repeated network requests.
  • Simplify examples down to a single tokenization_overview.php script that demonstrates token counts and token previews for multiple models.
  • Refresh README to document the new cache behavior, loading options, and a cleaner highlights section.

Breaking changes

  • Environment variable removal: TOKENIZERS_CACHE is no longer read or used.
    • Use the cacheDir argument when calling Tokenizer::fromHub() or rely on the standard Hugging Face cache (HF_HUB_CACHE, HF_HOME, OS defaults).
  • Cache semantics:
    • Hub downloads now use the Hugging Face Hub cache layout (huggingface/hub with blobs/snapshots/refs) rather than the old tokenizers-specific cache.
  • Dependency surface:
    • Hub loading now depends on codewithkyrian/huggingface (plus its HTTP stack) for all network and caching behavior.

- Replace custom HubLoader HTTP and cache logic with huggingface-php RepoManager
- Use snapshot()+manifest to cache tokenizer.json and tokenizer_config.json efficiently
- Remove TOKENIZERS_CACHE handling and custom cache-dir resolution in favor of standard HF cache
- Simplify README highlights and cache documentation to match new behavior
- Trim old, noisy examples and add a single tokenization_overview.php sample
- Update composer requirements to depend on codewithkyrian/huggingface

BREAKING CHANGE:
- TOKENIZERS_CACHE is no longer read; use cacheDir or HF_HUB_CACHE/HF_HOME instead.
- Hub loading behavior and cache layout now follow huggingface-php’s unified cache.
@CodeWithKyrian CodeWithKyrian force-pushed the feat/use-huggingface-php-hub branch from 9975057 to 552a24d Compare February 4, 2026 11:11
@CodeWithKyrian CodeWithKyrian merged commit e5db652 into main Feb 4, 2026
5 checks passed
@CodeWithKyrian CodeWithKyrian deleted the feat/use-huggingface-php-hub branch February 4, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant