An LLM never sees raw text. So what does it process?
A token is the smallest unit that an LLM reads and emits. It is usually a sub-word chunk of UTF-8 bytes that the tokenizer maps to an integer id drawn from a fixed vocabulary. The model itself is a function from sequences of token ids to sequences of token ids; it never sees raw characters or words.
The tokenizer is a separate component that runs before and after the model. On the way in, it splits text into pieces using a learned algorithm (usually byte-level BPE) and looks up an id for each piece. On the way out, it concatenates the byte sequences for emitted ids back into text.
The split between tokenizer and model is strict. The model's embedding matrix and output head are sized to exactly vocab_size, and ids only have meaning relative to one specific tokenizer.
Token counts depend on the tokenizer, not the text. 'embedding' is one token in cl100k_base and o200k_base, but two tokens in GPT-2's smaller vocabulary. Non-English text and code often tokenize less efficiently than English prose, which is why multilingual workloads cost more per character.
Cost, context window, and latency are all measured in tokens. A 100K-token context window holds roughly 75K English words, but far fewer in code or in non-Latin scripts. Anyone budgeting LLM workloads has to think in tokens, not in pages or characters.