com.phronemophobic.llama.util

next-token

(next-token ctx tokens)

Given a sequence of tokens, return the next token.

normalize-embedding

(normalize-embedding emb)

Normalize the embedding emb so that it matches output from llama.cpp's ./embedding example.

print-response

(print-response ctx prompt)(print-response ctx prompt opts)

Generates a response from prompt and print the results as they become available.

Returns nil.

tokenize

(tokenize ctx s)

Tokenize the string s into a collection of int tokens.

untokenize

(untokenize ctx tokens)

Given a sequence of tokens, return the string representation.