llama_tokenize
Encode text into token IDs for LLM processing, with options to add special tokens and include token strings.
Instructions
Convert text to token IDs
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"content": "<content>"
},
"name": "llama_tokenize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Text to tokenize | |
| add_special | No | Add BOS/EOS tokens | |
| with_pieces | No | Include token strings |