count-dataset-tokens

Count tokens in HuggingFace-like datasets with configurable tokenizers.

134|21|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/letta-ai/skills --skill count-dataset-tokens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: count-dataset-tokens
Source: https://github.com/letta-ai/skills/tree/main/ai/benchmarks/letta/terminal-bench-2/trajectory-only/count-dataset-tokens
Command: npx skills add https://github.com/letta-ai/skills --skill count-dataset-tokens

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides counting tokens in datasets using specific tokenizers, including loading data, filtering by domain, and aggregating token counts.

Core Features & Use Cases

  • Explore dataset structure and field values before counting
  • Load and apply tokenizer to text fields
  • Robust counting with edge-case handling and documentation of assumptions

Quick Start

Load a dataset, apply the tokenizer named in the task, and compute total tokens across the dataset.

Frequently Asked Questions about count-dataset-tokens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I count tokens across a HuggingFace dataset?

Token counting across datasets involves loading your data, selecting the appropriate tokenizer, and aggregating token counts across all text fields. This Skill automates that process—it discovers text fields in your dataset, applies your chosen tokenizer to each entry, handles batching with progress checkpoints, and delivers total token counts with verification.

Can I filter datasets by domain or category before counting tokens?

Yes. This Skill supports domain and category filtering, allowing you to count tokens only within specific subsets of your dataset rather than across the entire corpus. This is useful when you need token estimates for particular content types or splits.

What tokenizer options does token counting support?

You specify the tokenizer explicitly—the Skill applies it to your dataset's text fields. This gives you control over which tokenization scheme matches your model or use case, whether that's a standard HuggingFace tokenizer or a domain-specific variant.

How does the Skill handle datasets with multiple text fields?

The Skill discovers your dataset's schema automatically and tokenizes all relevant text fields per entry. It then aggregates counts across fields and entries, so you get a complete token tally for mixed-format datasets without manual field selection.

What happens if token counting fails mid-dataset?

The Skill includes batch processing with progress checkpoints and edge-case handling. It documents assumptions throughout the counting process and surfaces any anomalies, so you can verify results and resume from checkpoints if needed rather than restarting from scratch.

Why is exact tokenizer selection important for dataset analysis?

Token counts vary significantly based on the tokenizer used—different tokenizers produce different counts for the same text. Using the exact tokenizer your model will use ensures accurate token budgeting and prevents surprises during processing or training.