
01
Clone the tokenizer repository
Clone the tokenizer repository. The Nzinga tokenizer is one JSON file, so nothing else is needed to count tokens.
TOKENIZER
tokenizer/gemma3-afx32k.json
02
Install the packages
Python for the tokenizer, Node 22 for the API. Each repository pins its versions.
pip install tokenizers==0.23.3
# and, in nzinga-voice
npm install
03
Send a request
Count tokens in Python, or ask the API for a sign-in code.
quickstart.py
from tokenizers import Tokenizer
tok = Tokenizer.from_file("tokenizer/gemma3-afx32k.json")
enc = tok.encode(
"Huku shirika la Save the Children likitela pamoja timu",
is_pretokenized=False,
add_special_tokens=False,
)
print(len(enc.ids), enc.tokens)
quickstart.ts
import { normalizeE164 } from "@nzinga/core";
const phone = normalizeE164("+1 555 000 0001");
const res = await fetch("http://127.0.0.1:3000/v1/auth/start", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ phone }),
});
console.log(await res.json());
quickstart.sh
curl http://127.0.0.1:3000/v1/auth/start \
-H "content-type: application/json" \
-d '{"phone":"+15550000001"}'
Note
The dev server prints sign-in codes to the console and refuses production.
04
Open the app
Start Expo and open the app in Expo Go. With no API address it runs in demo mode.
$ npx expo start
demo
health
4 s
sign_in
code 482917
invite
8 characters
consent
your choice
1 founder · 5 recordings · Demo data chip