MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / tokenize

Function tokenize

examples/server/chat.mjs:62–73  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

60}
61
62async function tokenize(content) {
63 const result = await fetch(`${API_URL}/tokenize`, {
64 method: 'POST',
65 body: JSON.stringify({ content })
66 })
67
68 if (!result.ok) {
69 return []
70 }
71
72 return await result.json().tokens
73}
74
75const n_keep = await tokenize(instruction).length
76

Callers 3

ingest_imagesMethod · 0.70
update_slotsMethod · 0.70
chat.mjsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected