erllama_model_stub (erllama v0.6.2)

View Source

Deterministic stub backend for erllama_model`. No NIF, no GGUF. tokenize uses `erlang:phash2/1` over whitespace- delimited words; decode_one produces a deterministic next-token from the contexts hash; pack/unpack serialise the token list as bytes. Useful for tests of the cache integration that don't need real inference.

Summary

Functions

applied_adapters(Stub)

apply_adapters(Stub, Adapters)

apply_chat_template(S, Request)

clear_sampler(Stub)

cleared(Stub)

configure_sampler(Stub, Cfg)

decode_one(S, ContextTokens)

detokenize(S, Tokens)

embed(S, Tokens)

init(Config)

kv_pack(S, Tokens)

kv_pack(S, Tokens, SeqId)

kv_unpack(S, Bin)

kv_unpack(S, Bin, SeqId)

last_sampler_cfg(Stub)

load_adapter(Stub, Path)

prefill(S, Tokens)

sampler_free(Sampler)

sampler_new(S, Cfg)

seq_rm(S, SeqId)

set_grammar(Stub, Grammar)

step(S, Ops)

terminate(S)

thinking_signature(S, SeqId, Bytes)

tokenize(S, Text)

unload_adapter(Stub, Ref)