MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / tokenize

Function tokenize

llama_cpp/server/app.py:561–567  ·  view source on GitHub ↗
(
    body: TokenizeInputRequest,
    llama_proxy: LlamaProxy = Depends(get_llama_proxy),
)

Source from the content-addressed store, hash-verified

559 tags=[extras_tag],
560)
561async def tokenize(
562 body: TokenizeInputRequest,
563 llama_proxy: LlamaProxy = Depends(get_llama_proxy),
564) -> TokenizeInputResponse:
565 tokens = llama_proxy(body.model).tokenize(body.input.encode("utf-8"), special=True)
566
567 return TokenizeInputResponse(tokens=tokens)
568
569
570@router.post(

Callers

nothing calls this directly

Calls 3

tokenizeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…