token_counter 1.0.0
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_counterWith Flutter:
$ flutter pub add token_counterThis will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
token_counter: ^1.0.0Alternatively, 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';