1
0
Fork
You've already forked ai-agent-coding
0

Add llama.cpp parameter estimator for VRAM fit #6

Merged
Copilot merged 2 commits from copilot/determine-llama-cpp-parameters into main 2026年03月15日 17:17:03 +01:00
Copilot commented 2026年03月14日 19:32:51 +01:00 (Migrated from github.com)
Copy link

This change introduces a script to determine the llama.cpp flags needed to run a model on a given system, accounting for VRAM fit, model layers, MoE offsets, context size, batch size, and KV cache quantization.

  • Estimator script: adds bin/llama-cpp-params.py to parse GGUF metadata or overrides, compute memory usage, and recommend --n-gpu-layers plus core runtime flags.
  • Memory modeling: estimates per-layer weights, KV cache, and batch buffers; supports MoE CPU layer offsets and cache quantization sizes.
  • Docs & tests: documents usage in bin/README.md and adds focused unit tests for parsing and estimation helpers.

Example:

./bin/llama-cpp-params.py \
 --model-path /models/mixtral.gguf \
 --vram 24GB \
 --ctx-size 8192 \
 --batch-size 2048 \
 --ubatch-size 512 \
 --cache-type-k q8_0 \
 --cache-type-v q8_0 \
 --moe-cpu-offset 4

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

This change introduces a script to determine the llama.cpp flags needed to run a model on a given system, accounting for VRAM fit, model layers, MoE offsets, context size, batch size, and KV cache quantization. - **Estimator script**: adds `bin/llama-cpp-params.py` to parse GGUF metadata or overrides, compute memory usage, and recommend `--n-gpu-layers` plus core runtime flags. - **Memory modeling**: estimates per-layer weights, KV cache, and batch buffers; supports MoE CPU layer offsets and cache quantization sizes. - **Docs & tests**: documents usage in `bin/README.md` and adds focused unit tests for parsing and estimation helpers. Example: ```bash ./bin/llama-cpp-params.py \ --model-path /models/mixtral.gguf \ --vram 24GB \ --ctx-size 8192 \ --batch-size 2048 \ --ubatch-size 512 \ --cache-type-k q8_0 \ --cache-type-v q8_0 \ --moe-cpu-offset 4 ``` <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security)
peterwwillis (Migrated from github.com) reviewed 2026年03月14日 19:32:51 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mutablecc/ai-agent-coding!6
Reference in a new issue
mutablecc/ai-agent-coding
No description provided.
Delete branch "copilot/determine-llama-cpp-parameters"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?