token_counter 1.0.0 copy "token_counter: ^1.0.0" to clipboard
token_counter: ^1.0.0 copied to clipboard

Token counter for popular LLMs (OpenAI GPT, Anthropic Claude, Google Gemini, Meta Llama) with multi-language support. Pure Dart, works on all Flutter platforms and Dart VM.

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add token_counter

With Flutter:

 $ flutter pub add token_counter

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  token_counter: ^1.0.0

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:token_counter/token_counter.dart';
0
likes
160
points
243
downloads

Documentation

API reference

Publisher

verified publisherwarashibetech.com

Weekly Downloads

Token counter for popular LLMs (OpenAI GPT, Anthropic Claude, Google Gemini, Meta Llama) with multi-language support. Pure Dart, works on all Flutter platforms and Dart VM.

Repository (GitHub)
View/report issues

Topics

#llm #tokenizer #openai #anthropic #gemini

License

MIT (license)

More

Packages that depend on token_counter