Changelog
v0.4.2
Changed
- llama.cpp submodule — Updated to latest upstream (b8179).
v0.4.1
Improved
- Error handling —
Chat.apply_template/3,Tokenizer.encode/3, andTokenizer.decode/2now return{:error, reason}instead of crashing when NIFs raise. - Telemetry documentation — Server moduledoc documents all telemetry events, measurements, and metadata.
- Typespecs — Added
@spectoServer.start_link/1.
Changed
- llama.cpp submodule — Updated to latest upstream (b8157).
v0.4.0
Added
- Full model loading params —
main_gpu,split_mode,tensor_splitfor multi-GPU placement;use_mlockanduse_direct_iofor memory control;vocab_onlyfor cheap model introspection without loading weights. - Server GPU forwarding —
Server.start_link/1now forwardsmain_gpu,split_mode,tensor_split,use_mlock, anduse_direct_iotoModel.load/2.
v0.3.0
Added
- Jinja chat templates — switched from
llama_chat_apply_template()C API to the full Jinja-basedcommon_chat_templates_apply()engine from llama.cpp's common library. enable_thinkingoption — passenable_thinking: falsetoChat.apply_template/3,chat/3,stream_chat/3,chat_completion/3, andstream_chat_completion/3to disable CoT reasoning for models like Qwen3/3.5.chat_template_kwargsoption — pass arbitrary key-value pairs to the Jinja template engine.- Penalty parameters —
penalty_repeat,penalty_freq, andpenalty_presentoptions for repetition/frequency/presence penalties in sampling. - OpenAI-compatible response format —
chat_completion/3andstream_chat_completion/3returnChatCompletionandChatCompletionChunkstructs. - Qwen3.5 benchmark results in README — Qwen3.5-27B and Qwen3.5-35B-A3B on Apple M4 Max.
Changed
Chat.apply_template/3now uses the Jinja engine and takes the model ref directly (no longer accepts:templateoption for raw template strings).- Linked
libcommon.afrom llama.cpp build (previously excluded). LlamaModelRAII wrapper now cachescommon_chat_templatesat model load time.
v0.2.0
Added
- Continuous batching server (
LlamaCppEx.Server) — GenServer with slot pool for concurrent multi-sequence inference. One forward pass per tick with decode tokens and prefill chunks mixed in a single batch. - Embeddings (
LlamaCppEx.Embedding) —embed/3andembed_batch/3with L2 normalization and configurable pooling type. - Grammar-constrained generation — GBNF grammar support via
grammarandgrammar_rootoptions inSampler.create/2andgenerate/3. - Batched inference primitives —
prefill/3,decode_batch/3,decode_token/4,batch_eval/2,sampler_sample_at/3NIFs for building custom inference loops. - Streaming via Server —
LlamaCppEx.Server.stream/3for token-by-token streaming through the batched server. - Telemetry events —
[:llama_cpp_ex, :server, :tick]and[:llama_cpp_ex, :server, :request, :done]for observability. - Benchmark suite (
bench/) — Benchee-based benchmarks for single-sequence and server generation, plus a custom continuous batching harness measuring throughput scaling.
Changed
Sampler.create/1now requires the model as the first argument:Sampler.create(model, opts).Context.create/2accepts new options::embeddings,:pooling_type,:n_seq_max.
v0.1.0
Initial release.
- Model loading and introspection
- Text generation with configurable sampling
- Streaming token generation via
Stream.resource/3 - Chat template support
- Tokenization and detokenization
- Metal, CUDA, Vulkan, and CPU backends
- RAII resource management via
fine