You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe38cbf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
## [0.3.37] MoE CPU Offloading, O(1) Speculative Decoding, Thread-Safe Abort & New LLM Wiki
11
+
12
+
- docs: A basic new documentation system for the LLM-Wiki has been initially established.
13
+
- Based on the continuously optimized `SCHEMA.md`, I am attempting to enable AI to automatically learn code files and write and update corresponding Markdown documents.
14
+
- Currently, the documentation under the path `/docs/wiki/` is complete:
15
+
-`core/Llama.md`
16
+
-`modules/LlamaCache.md`
17
+
-`modules/LlamaEmbedding.md`
18
+
-`modules/LlamaSpeculative.md`
19
+
-`SCHEMA.md`
20
+
-`contributing-to-wiki.md`
21
+
-`index.md`
22
+
- The Github Wiki is now also synchronized with `/docs/wiki/index.md`
23
+
- Note: The LLM-wiki is still being expanded.
24
+
25
+
- docs: update LLM wiki schema to v0.3
26
+
- Add schema metadata, documentation language rules, expanded page templates, attribute/state documentation guidance, and clearer update rules for LLM-maintained llama-cpp-python wiki pages.
27
+
28
+
- feat(llama): add fine-grained MoE CPU offloading controls
29
+
- Introduce `cpu_moe` (bool) and `n_cpu_moe` (int) parameters to `Llama.__init__` for precise Mixture of Experts (MoE) weight offloading.
30
+
-`cpu_moe=True` forces all MoE expert weights to the CPU memory, regardless of `n_gpu_layers`.
31
+
-`n_cpu_moe=N` offloads the expert weights of the first N layers to the CPU, while keeping attention and router weights on the GPU.
32
+
- Enhance `n_gpu_layers` to accept string literals "auto" (equivalent to -1) and "all" (equivalent to -2) alongside exact integers, improving configuration readability.
33
+
- Update internal module aliases (e.g., `llama_cpp` to `llama_cpp_lib`) to avoid naming conflicts with the underlying C library.
34
+
- Integrate `ggml_backend_cpu_buffer_type` to map specific tensor overrides (via regex) directly to CPU buffers during model load.
35
+
36
+
- feat(_ggml): implement ggml-backend API bindings and fix type hints
37
+
- Introduces extensive ctypes bindings for `ggml-backend.h` (devices, buffers, registries, and CPU buffer types) to support advanced memory routing like MoE CPU offloading. Also fixes various static typing warnings by adding `# type: ignore` to pointer annotations.
38
+
-*Note: Synchronize ggml's ctypes calls as needed, but won't fully implement it, because most of it is called at the lower level in the upstream llama.cpp.*
39
+
40
+
- feat(handler): Support `add_generation_prompt` parameter pass to `MTMDChatHandler`
41
+
- supports disabling assistant part injection, used to support the multimodal `assistant_prefill` functionality.
- Add `AbortCriteria` class and a thread-safe `Llama.abort()` method to allow graceful interruption of ongoing text generation from external threads (e.g., UI or async environments).
45
+
- Automatically inject `AbortCriteria` into the stopping criteria sequence at the start of `_create_completion`.
46
+
- Ensure that when an abort is triggered, the partially generated `completion_tokens` are correctly detokenized and preserved.
47
+
- Set `finish_reason` to `"abort"` when generation is interrupted, allowing downstream streaming clients to correctly identify manual cancellations.
48
+
- Simplify and optimize the stopping criteria evaluation logic within the core `generate` loop.
49
+
- Reorganize and sort module imports for better readability.
50
+
- Update /docs/wiki/core/Llama.md for `abort()` and example code
- Add `LlamaNGramMapDecoding` to `llama_speculative.py`, implementing an ultra-fast speculative decoder based on a hash inverted index and incremental updates.
54
+
- Achieve O(1) time complexity for draft token generation, completely eliminating the CPU bottleneck present in the legacy Numpy sliding window approach.
55
+
- Update `README.md` and `docs/wiki/core/Llama.md` to recommend `LlamaNGramMapDecoding` as the default and fastest speculative decoding method, along with updated initialization examples.
56
+
- Add docs comment to the speculative decoding classes for better developer experience.
57
+
- Add warnings to the legacy `LlamaPromptLookupDecoding` class regarding its high computational overhead for long contexts.
58
+
59
+
- docs: Update README.md
60
+
61
+
- feat(types): introduce MCP definitions and align with latest OpenAI spec
62
+
- Add comprehensive Model Context Protocol (MCP) type definitions, including `MCPTool`, `MCPToolCall`, `MCPListTools`, connector IDs, and approval filters to support remote server tool calling.
63
+
- Add `ServiceTier` literal ("auto", "default", etc.) and include the `service_tier` field in `CreateChatCompletionResponse`.
64
+
- Restrict `finish_reason` in completion responses to strict standard literals (`stop`, `length`, `tool_calls`, `content_filter`, `function_call`).
65
+
- Introduce `ChatCompletionMessageCustomToolCall` to support custom tool calls generated by the model.
66
+
- Update `ChatCompletionRequestAssistantMessage` to include the `name` field and add descriptive docstrings to message types.
67
+
68
+
- docs: initialize LLM Wiki structure for better documentation maintenance
69
+
- Create docs/wiki/ directory with full folder structure
70
+
- Add SCHEMA.md, index.md and contributing guidelines
71
+
- Set up core/, features/, modules/, examples/, types/ and subdirectories
72
+
- Prepare for LLM-powered living documentation (Llama class, multi-modal chat handlers, vision/audio examples, etc.)
73
+
- Include .gitkeep files to preserve empty directories
74
+
75
+
This lays the foundation for a modern, maintainable wiki that will replace outdated static docs.
76
+
Future commits will populate pages with up-to-date content generated from latest source code.
77
+
78
+
- chore(ci): upgrade astral-sh/setup-uv@v7 and Jimver/cuda-toolkit@v0.2.35 (Node 24 runtime)
79
+
80
+
- feat: Update llama.cpp to [ggml-org/llama.cpp/commit/63d93d17336e41e4cc73a64451e5b1d2477abdb1](https://github.com/ggml-org/llama.cpp/commit/63d93d17336e41e4cc73a64451e5b1d2477abdb1)
81
+
82
+
- feat: Sync llama.cpp llama/mtmd API Binding 20260421
83
+
84
+
More information see: https://github.com/JamePeng/llama-cpp-python/compare/b97cb637cd6124fc47f569721b1716014bd856a8...374c0d00aab924f03c18a2a53ab65c2fa20ce66c
0 commit comments