=============== LIBRARY RULES =============== From library maintainers: - Treat README.md and docs/contracts/RUNTIME_SUPPORT.md as the human-readable support authority. - Treat docs/contracts/qwen-release.json as the machine-readable Qwen artifact authority. - Do not generalize qualified artifacts or hardware profiles to arbitrary GGUF files, model families, or Macs. - Use the hebrus command names in new examples; legacy names are compatibility aliases. - Treat benchmark results as condition-scoped evidence, not universal or cross-engine performance claims. - Describe the local API endpoints as documented subsets rather than full OpenAI or Anthropic compatibility. ### Test Installation Source: https://github.com/andreaborio/hebrus/blob/main/QA_BEFORE_RELEASES.md Confirms correct installation of executables and aliases into a temporary directory. ```bash make install-test ``` -------------------------------- ### Install bridge revision from source Source: https://github.com/andreaborio/hebrus/blob/main/docs/guides/MIGRATING_TO_HEBRUS.md Perform a user-local installation by switching to the announced tag and building the project. ```sh git fetch --tags origin git switch --detach make -j make model-free-test make install PREFIX="$HOME/.local" export PATH="$HOME/.local/bin:$PATH" ``` -------------------------------- ### Install Hebrus locally Source: https://github.com/andreaborio/hebrus/blob/main/README.md Perform a user-local installation and verify the build information. ```sh make install PREFIX="$HOME/.local" export PATH="$HOME/.local/bin:$PATH" hebrus --build-info ``` -------------------------------- ### Start the Model Source: https://github.com/andreaborio/hebrus/blob/main/docs/deepseek-expert-major-v2.md Commands to compile and execute the model using the hebrus binary with a specified context size. ```sh make -j8 ./hebrus \ -m /absolute/path/to/DEEPSEEK-DS4-EXPERT-MAJOR-V2.gguf \ --ctx 32768 ``` -------------------------------- ### Start the Hebrus server Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Launch the server with a specified model path and KV cache configuration. ```sh ./hebrus-server \ -m /absolute/path/to/QUALIFIED-DS4-ExpertMajor-v2.gguf \ --ctx 100000 --kv-disk-dir /tmp/ds4-kv --kv-disk-space-mb 8192 ``` -------------------------------- ### Install and Manage Hebrus Binaries Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Use the Makefile to install, uninstall, or test the engine binaries and associated resources. ```sh make install PREFIX="$HOME/.local" make install DESTDIR="$PWD/package-root" PREFIX=/usr/local make uninstall DESTDIR="$PWD/package-root" PREFIX=/usr/local make install-test ``` -------------------------------- ### Start Server with Disk KV Cache Source: https://github.com/andreaborio/hebrus/blob/main/QA_BEFORE_RELEASES.md Launch the server with specific disk KV cache parameters to test caching behavior and eviction policies. ```sh ./ds4-server -m "$DEEPSEEK_V2" --ctx 100000 --kv-disk-dir /tmp/ds4-kv --kv-disk-space-mb 8192 ``` -------------------------------- ### Build and run the interactive CLI Source: https://github.com/andreaborio/hebrus/blob/main/docs/glm52-expert-major-v2.md Compile the project and start the interactive CLI with the specified model and context size. ```sh make -j8 ./hebrus \ -m /absolute/path/to/GLM-5.2-DS4-ExpertMajor-v2-Q2_K.gguf \ --ctx 8192 ``` -------------------------------- ### Start the local API server Source: https://github.com/andreaborio/hebrus/blob/main/docs/glm52-expert-major-v2.md Launch the Hebrus server to provide local API access to the model. ```sh ./hebrus-server \ -m /absolute/path/to/GLM-5.2-DS4-ExpertMajor-v2-Q2_K.gguf \ --ctx 8192 ``` -------------------------------- ### Start Hebrus HTTP Server Source: https://github.com/andreaborio/hebrus/blob/main/README.md Launch the local server using a specific GGUF model artifact and context window size. ```sh ./hebrus-server \ -m gguf/Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-MLX-Affine4-G64.gguf \ --ctx 8192 ``` -------------------------------- ### Stage Hebrus for packaging Source: https://github.com/andreaborio/hebrus/blob/main/README.md Commands for package builders to stage the installation without modifying the host filesystem. ```sh make install DESTDIR="$PWD/package-root" PREFIX=/usr/local make install-test make uninstall DESTDIR="$PWD/package-root" PREFIX=/usr/local ``` -------------------------------- ### Stage installation for packaging Source: https://github.com/andreaborio/hebrus/blob/main/docs/guides/MIGRATING_TO_HEBRUS.md Stage the build into a specific directory for package maintenance without modifying the host system. ```sh make install DESTDIR="$PWD/package-root" PREFIX=/usr/local ``` -------------------------------- ### Download Model and Run Inference Source: https://github.com/andreaborio/hebrus/blob/main/README.md Install necessary dependencies, fetch the required model artifact, and execute a prompt with specific context settings. ```sh python3 -m pip install -U huggingface_hub hf_xet ./download_model.sh qwen-v2 ./hebrus \ -m gguf/Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-MLX-Affine4-G64.gguf \ --ctx 8192 \ -p "Explain how bounded SSD expert streaming changes MoE inference." ``` -------------------------------- ### Start model with AUTO residency Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Initiate the engine with automatic residency detection for qualified DeepSeek or Qwen models. ```sh ./hebrus -m /absolute/path/to/QUALIFIED-DEEPSEEK-OR-QWEN-DS4-ExpertMajor-v2.gguf ``` -------------------------------- ### Enable Disk KV Cache Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Start the server with disk-based KV caching enabled by specifying the directory and space allocation. ```sh ./hebrus-server \ -m /absolute/path/to/QUALIFIED-DS4-ExpertMajor-v2.gguf \ --kv-disk-dir /tmp/ds4-kv --kv-disk-space-mb 8192 ``` -------------------------------- ### Run Steered Inference Source: https://github.com/andreaborio/hebrus/blob/main/dir-steering/README.md Examples of running the model with specific steering scales to achieve terse or verbose outputs. ```sh ./hebrus -m deepseek-v4-flash.gguf --nothink --temp 0 -n 160 \ --dir-steering-file dir-steering/out/verbosity.f32 \ --dir-steering-ffn -1 \ -p "Explain why databases use indexes." ``` ```sh ./hebrus -m deepseek-v4-flash.gguf --nothink --temp 0 -n 220 \ --dir-steering-file dir-steering/out/verbosity.f32 \ --dir-steering-ffn 2 \ -p "Explain why databases use indexes." ``` -------------------------------- ### Start an interactive chat session Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Launch the interactive CLI mode by omitting the prompt flag. ```sh ./hebrus -m /absolute/path/to/QUALIFIED-DS4-ExpertMajor-v2.gguf hebrus> ``` -------------------------------- ### Record current installation state Source: https://github.com/andreaborio/hebrus/blob/main/docs/guides/MIGRATING_TO_HEBRUS.md Capture the current Git state and service configuration before performing an upgrade to ensure rollback capability. ```sh git rev-parse HEAD git status --short git remote -v ds4 --build-info ds4 --capabilities=json ``` -------------------------------- ### Configure GPU Power Usage via CLI Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Examples of applying the --power flag to various Hebrus tools to limit GPU utilization and reduce thermal output. ```sh ./hebrus -m /absolute/path/to/QUALIFIED-DS4-ExpertMajor-v2.gguf --power 50 ./hebrus-agent -m /absolute/path/to/QUALIFIED-DS4-ExpertMajor-v2.gguf --power 70 ./hebrus-server -m /absolute/path/to/QUALIFIED-DS4-ExpertMajor-v2.gguf --power 40 --ctx 100000 ``` -------------------------------- ### GET /v1/models Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Retrieves the list of available models. ```APIDOC ## GET /v1/models ### Description Returns a list of models currently available on the server. ### Method GET ### Endpoint /v1/models ``` -------------------------------- ### DeepSeek-V4 Quantization with Imatrix Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/imatrix/README.md Examples of regenerating GGUF files using imatrix data for different quantization levels and model variants. ```sh gguf-tools/deepseek4-quantize \ --hf ../deepseek-v4-quants/hf/DeepSeek-V4-Flash \ --template ../deepseek-v4-quants/gguf/DeepSeek-V4-Flash-Q4KExperts-F16HC-F16Compressor-F16Indexer-Q8Attn-Q8Shared-Q8Out-chat-v2.gguf \ --out ../deepseek-v4-quants/gguf/DeepSeek-V4-Flash-Q4KExperts-F16HC-F16Compressor-F16Indexer-Q8Attn-Q8Shared-Q8Out-chat-v2-imatrix.gguf \ --imatrix ../deepseek-v4-quants/imatrix/DeepSeek-V4-Flash-chat-v2-routed-moe-ds4-1p5m.dat ``` ```sh gguf-tools/deepseek4-quantize \ --hf ../deepseek-v4-quants/hf/DeepSeek-V4-Flash \ --template ../deepseek-v4-quants/gguf/DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2.gguf \ --out ../deepseek-v4-quants/gguf/DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix.gguf \ --imatrix ../deepseek-v4-quants/imatrix/DeepSeek-V4-Flash-chat-v2-routed-moe-ds4-1p5m.dat ``` ```sh gguf-tools/deepseek4-quantize \ --hf ../deepseek-v4-quants/hf/DeepSeek-V4-Pro \ --template ../deepseek-v4-quants/gguf/DeepSeek-V4-Pro-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-Instruct.gguf \ --out ../deepseek-v4-quants/gguf/DeepSeek-V4-Pro-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-Instruct-imatrix-small.gguf \ --imatrix ../deepseek-v4-quants/imatrix/DeepSeek-V4-Pro-Instruct-routed-moe-ds4-small.dat \ --threads 24 ``` -------------------------------- ### Standard Model Startup Command Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-20-glm52-expert-major-v2.md Executes the model with default settings and a specified context window. ```sh ./ds4 \ -m /absolute/path/to/GLM-5.2-DS4-ExpertMajor-v2-Q2_K.gguf \ --ctx 8192 ``` -------------------------------- ### Execute Qwen model with standard startup Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-21-qwen-unified-affine-auto-ssd.md Standard command to initialize the model using the unified GGUF artifact. ```sh ./ds4 -m /absolute/path/to/Qwen3.6-35B-A3B-DS4-ExpertMajor-v2-MLX-Affine4-G64.gguf ``` -------------------------------- ### Build the backend Source: https://github.com/andreaborio/hebrus/blob/main/CONTRIBUTING.md Commands to clean and build the default backend. ```sh make clean make ``` -------------------------------- ### Execute Qwen Models with AUTO Startup Source: https://github.com/andreaborio/hebrus/blob/main/tests/qwen/README.md Run Qwen models using the default AUTO startup mode to verify model paths and basic inference functionality. ```sh QWEN_V2=/absolute/path/to/Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-MLX-Affine4-G64.gguf QWEN_Q2_V2=/absolute/path/to/Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-Q2_K_XL.gguf ./hebrus -m "$QWEN_V2" --ctx 8192 \ -n 32 --temp 0 \ -p 'Scrivi solo una breve funzione Python che somma due interi.' ./hebrus -m "$QWEN_Q2_V2" --ctx 8192 \ -n 32 --temp 0 \ -p 'Scrivi solo una breve funzione Python che somma due interi.' ``` -------------------------------- ### Launch Qwen3.6 Model Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-20-qwen-expert-major-v2.md Standard startup command for the Qwen3.6 model using the v2 store on Apple Metal. ```sh ./ds4 \ -m /absolute/path/to/Qwen3.6-35B-A3B-DS4-ExpertMajor-v2-Q4_K_S.gguf \ --ctx 8192 ``` -------------------------------- ### Build and Verify Q2_K_XL Artifacts Source: https://github.com/andreaborio/hebrus/blob/main/docs/qwen-expert-major-store.md Commands to inspect, build, and verify the Q2_K_XL source model. ```sh python3 gguf-tools/ds4-expert-major.py inspect CANONICAL-Q2-K-XL.gguf python3 gguf-tools/ds4-expert-major.py build \ CANONICAL-Q2-K-XL.gguf \ Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-Q2_K_XL.gguf python3 gguf-tools/ds4-expert-major.py verify \ CANONICAL-Q2-K-XL.gguf \ Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-Q2_K_XL.gguf ``` -------------------------------- ### Execute Qwen 24G Release Gate Runner Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-24-qwen-24g-cache-guard.md Run the loopback-only test runner with the required API key and output directory. Ensure the output directory does not exist prior to execution. ```sh HEBRUS_API_KEY=... python3 tests/qwen/run_24g_release_gate.py \ --output-dir /absolute/private/path/qwen-24g-release-evidence ``` -------------------------------- ### Imatrix CLI Options Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/imatrix/README.md Available command-line arguments for enabling imatrix support. ```text --imatrix FILE --imatrix-strict ``` -------------------------------- ### Build and Test Commands Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-21-upstream-metal-transfer-audit.md Commands used to clean, compile, and verify the candidate build before performance measurements. ```bash make clean make -j10 make -j10 ds4_test ./ds4_test --metal-kernels git diff --check ``` -------------------------------- ### Configure Codex CLI Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Set up the model provider and execute the CLI command. ```toml [model_providers.ds4] name = "DS4" base_url = "http://127.0.0.1:8000/v1" wire_api = "responses" stream_idle_timeout_ms = 1000000 ``` ```sh codex --model deepseek-v4-flash -c model_provider=ds4 ``` -------------------------------- ### Run CPU-MoE and fit-margin probe commands Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-15-qwen-ds4-vs-llamacpp.md Executes alternative benchmark configurations to test MoE layer placement and memory fit margins. ```sh ./llama-bench \ -m "$MODEL" -p 1 -n 4 -r 1 -t 8 \ -ngl 99 -ncmoe 40 -b 1 -ub 1 -fa on -mmp 1 \ --no-warmup --progress ``` ```sh ./llama-bench \ -m "$MODEL" -p 1 -n 4 -r 1 -t 8 \ -ngl -1 -fitt 4096 -fitc 8192 \ -b 1 -ub 1 -fa on -mmp 1 \ --no-warmup --progress ``` -------------------------------- ### Configure Expert Profiling and Hotlist Streaming Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-17-deepseek-qwen-transfer-audit.md Use these environment variables to generate a hotlist profile and enable expert streaming in the server binary. ```sh DS4_EXPERT_PROFILE=/tmp/deepseek-profile.json \ DS4_EXPERT_HOTLIST=/tmp/deepseek-hotlist.txt \ ./build/metal-arm64/bin/ds4-bench ... DS4_METAL_STREAMING_EXPERT_HOTLIST=/tmp/deepseek-hotlist.txt \ ./build/metal-arm64/bin/ds4-server ... ``` -------------------------------- ### Deterministic Benchmark Command Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-20-glm52-expert-major-v2.md Runs the model with a specific prompt file, zero temperature for determinism, and a token generation limit. ```sh ./ds4 \ -m /absolute/path/to/GLM-5.2-DS4-ExpertMajor-v2-Q2_K.gguf \ --ctx 8192 \ --prompt-file /tmp/glm-prefill-288-exact.txt \ --temp 0 -n 32 ``` -------------------------------- ### Execute Qwen Models with Hebrus Source: https://github.com/andreaborio/hebrus/blob/main/docs/qwen-expert-major-store.md Commands to build the project and run specific Qwen model artifacts using the Hebrus runtime. ```sh make -j8 ./hebrus \ -m /absolute/path/to/Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-MLX-Affine4-G64.gguf \ --ctx 8192 ./hebrus \ -m /absolute/path/to/Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-Q2_K_XL.gguf \ --ctx 8192 ``` -------------------------------- ### Build the quality scorer Source: https://github.com/andreaborio/hebrus/blob/main/CONTRIBUTING.md Compile the quality-score tool using make. ```sh make -C gguf-tools quality-score ``` -------------------------------- ### Build Local Targets Source: https://github.com/andreaborio/hebrus/blob/main/QA_BEFORE_RELEASES.md Performs a clean build of the project. ```bash make clean && make ``` -------------------------------- ### Benchmark GLM 5.2 Indexed-Prefill Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-14-m5-pro.md Shell commands to prepare the prompt file and execute the benchmark with indexed-prefill preparation toggled off and on. ```sh MODEL=/path/to/glm52-ds4-native-64g.gguf PROMPT_SOURCE=docs/benchmarks/prompts/glm-prefill-288.txt PROMPT=/tmp/glm-prefill-288-exact.txt perl -0pe 's/\n\z/ /' "$PROMPT_SOURCE" > "$PROMPT" # Indexed-prefill preparation OFF. env DS4_GLM_ROUTER_AHEAD_PREFETCH=1 \ DS4_METAL_DISABLE_STREAMING_EXPERT_READAHEAD=1 \ ./ds4 -m "$MODEL" --ssd-streaming \ --ssd-streaming-cache-experts 528 \ --prompt-file "$PROMPT" -n 16 --temp 0 # Indexed-prefill preparation ON. env DS4_GLM_ROUTER_AHEAD_PREFETCH=1 \ DS4_METAL_DISABLE_STREAMING_EXPERT_READAHEAD=1 \ DS4_METAL_ENABLE_GLM_INDEXED_PREFILL_PREPARE=1 \ ./ds4 -m "$MODEL" --ssd-streaming \ --ssd-streaming-cache-experts 528 \ --prompt-file "$PROMPT" -n 16 --temp 0 ``` -------------------------------- ### Build GGUF Tools Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/README.md Compile the C-based GGUF tools using make. ```sh make -C gguf-tools ``` -------------------------------- ### Run all tests Source: https://github.com/andreaborio/hebrus/blob/main/CONTRIBUTING.md Execute the full suite of C test runners. ```sh make test ``` -------------------------------- ### Run 24 GiB Profile Benchmark Source: https://github.com/andreaborio/hebrus/blob/main/speed-bench/README.md Executes a benchmark using the 24 GiB memory profile with specific residency and preload policies. ```bash DS4_M5_RESIDENCY=ssd \ DS4_M5_PRELOAD_POLICY=omit \ DS4_M5_MODEL=/absolute/path/to/qualified-qwen.gguf \ DS4_M5_MODEL_SHA256=dd17266185833a9f05531ce366fd7284ddca1ed64aa3dcf06e321e8c72c9ea3d \ DS4_M5_MODEL_HASH_EVIDENCE=/absolute/evidence/model-hash.txt \ DS4_M5_PREFIX=/absolute/evidence/qwen-24g \ DS4_QWEN_TELEMETRY_JSONL=/absolute/evidence/qwen-24g.qwen-telemetry.jsonl \ DS4_M5_CACHE_STATE=warm \ speed-bench/run_m5_dsflash_arm.sh qwen-24g auto 128 ``` -------------------------------- ### Prepare Model Hash Evidence Source: https://github.com/andreaborio/hebrus/blob/main/speed-bench/README.md Generates and verifies the hash evidence for a model file before running benchmarks. ```bash DS4_M5_MODEL=/absolute/path/to/qualified-qwen.gguf \ DS4_M5_MODEL_SHA256=dd17266185833a9f05531ce366fd7284ddca1ed64aa3dcf06e321e8c72c9ea3d \ DS4_M5_MODEL_HASH_EVIDENCE=/absolute/evidence/model-hash.txt \ speed-bench/run_m5_dsflash_arm.sh --prepare-model-hash-evidence ``` -------------------------------- ### Enable Full Expert Profiling Source: https://github.com/andreaborio/hebrus/blob/main/EXPERT_PRUNE.md Set the DS4_EXPERT_PROFILE_FULL environment variable to emit the full per-expert ranking instead of the default top-16. ```sh DS4_EXPERT_PROFILE_FULL=1 ds4 -m model.gguf --prompt-file corpus.txt ... # profile JSON carries the full ranking ``` -------------------------------- ### Build CPU Target Source: https://github.com/andreaborio/hebrus/blob/main/CONTRIBUTING.md Verifies that the CPU target builds correctly for portability testing. ```sh make cpu ``` -------------------------------- ### Execute a one-shot prompt Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Run a single prompt against a specified model file. ```sh ./hebrus \ -m /absolute/path/to/QUALIFIED-DS4-ExpertMajor-v2.gguf \ -p "Explain Redis streams in one paragraph." ``` -------------------------------- ### Execute Model-Window Endpoint Benchmark Source: https://github.com/andreaborio/hebrus/blob/main/speed-bench/README.md Runs a benchmark for the maximum supported context length of a specific model. ```bash DS4_M5_CTX_START=262015 \ DS4_M5_CTX_MAX=262015 \ DS4_M5_CTX_ALLOC=262144 \ DS4_M5_MAX_SECONDS=7200 \ speed-bench/run_m5_dsflash_arm.sh qwen-endpoint auto 128 ``` -------------------------------- ### Run llama-bench microbenchmark Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-15-qwen-ds4-vs-llamacpp.md Executes the official llama.cpp synthetic benchmark for performance reproducibility. ```sh ./llama-bench \ -m "$MODEL" -p 43 -n 96 -pg 43,96 -r 3 \ -t 18 -ngl 99 -fa on -b 64 -ub 64 -mmp 1 -o json --progress ``` -------------------------------- ### Compare Resident and SSD Streaming Modes Source: https://github.com/andreaborio/hebrus/blob/main/tests/qwen/README.md Run deterministic prompts in explicit resident and SSD streaming modes to compare output and logit consistency. ```sh ./hebrus -m "$QWEN_V2" --ctx 8192 --resident \ -n 32 --temp 0 \ -p 'Scrivi solo una breve funzione Python che somma due interi.' ./hebrus -m "$QWEN_V2" --ctx 8192 --ssd-streaming \ -n 32 --temp 0 \ -p 'Scrivi solo una breve funzione Python che somma due interi.' ``` -------------------------------- ### Build and Verify CPU Diagnostics Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Compiles the CPU diagnostic tools and checks build information. ```sh make cpu build/cpu-$(uname -m)/bin/ds4 --build-info ``` -------------------------------- ### Execute Model-Free Gate Tests Source: https://github.com/andreaborio/hebrus/blob/main/tests/qwen/README.md Runs the full suite of Qwen metadata, reference, unicode, tokenizer, expert group, and metal kernel tests. ```sh make qwen-metadata-test \ qwen-reference-test \ qwen-unicode-test \ qwen-tokenizer-test \ qwen-expert-group-test \ qwen-iq-metal-kernel-test \ qwen-q5-metal-kernel-test \ qwen-gdn-controls-metal-kernel-test \ qwen-fused-split-q-norm-metal-kernel-test python3 tests/qwen/test_compare_logits.py -v ./ds4_test --metal-kernels ``` -------------------------------- ### Execute with Expert Pruning Source: https://github.com/andreaborio/hebrus/blob/main/EXPERT_PRUNE.md Run the model with the CPU router enabled and the expert prune mask file specified. ```sh DS4_METAL_ENABLE_STREAMING_IQ2_CPU_ROUTER=1 DS4_EXPERT_PRUNE_MASK=mask.txt \ ds4 -m coder-iq2.gguf -p "Write a function …" --ssd-streaming --ssd-streaming-cache-experts 40GB ``` -------------------------------- ### Hebrus CLI and Build Commands Source: https://github.com/andreaborio/hebrus/blob/main/GOLD_METAL_SSD.md Commands for building the project and executing model inference with specific memory and streaming configurations. ```sh make # publishes ./hebrus* plus legacy ./ds4* aliases ./hebrus -m DEEPSEEK-OR-QWEN-DS4-ExpertMajor-v2.gguf # AUTO ./hebrus -m DEEPSEEK-OR-QWEN-DS4-ExpertMajor-v2.gguf --resident ./hebrus -m DEEPSEEK-OR-QWEN-DS4-ExpertMajor-v2.gguf --ssd-streaming ./hebrus -m GLM-5.2-DS4-ExpertMajor-v2-Q2_K.gguf --ctx 8192 # AUTO -> SSD ./hebrus --build-info ``` -------------------------------- ### Enable DeepSeek Expert Tile Prefill Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-17-deepseek-native-expert-major.md Activates the expert tile prefill optimization for the benchmark utility. ```sh DS4_METAL_ENABLE_DEEPSEEK_EXPERT_TILE_PREFILL=1 ./ds4-bench ... ``` -------------------------------- ### Run repository verification tests Source: https://github.com/andreaborio/hebrus/blob/main/docs/guides/MIGRATING_TO_HEBRUS.md Execute these make targets to verify the build integrity when building from source. ```makefile make capabilities-test make command-alias-test make install-test ``` -------------------------------- ### Execute ExpertMajor v2 model Source: https://github.com/andreaborio/hebrus/blob/main/docs/expert-major-v2-roadmap.md Run a model using the ExpertMajor v2 format on local Apple Metal hardware. ```sh ./hebrus -m /absolute/path/to/MODEL-DS4-ExpertMajor-v2.gguf --ctx 8192 ``` -------------------------------- ### Configure opencode provider Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Add the local ds4 provider to the opencode configuration file. ```json { "$schema": "https://opencode.ai/config.json", "provider": { "ds4": { "name": "ds4.c (local)", "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://127.0.0.1:8000/v1", "apiKey": "dsv4-local" }, "models": { "deepseek-v4-flash": { "name": "DeepSeek V4 Flash (ds4.c local)", "limit": { "context": 100000, "output": 384000 } } } } }, "agent": { "ds4": { "description": "DeepSeek V4 Flash served by local ds4-server", "model": "ds4/deepseek-v4-flash", "temperature": 0 } } } ``` -------------------------------- ### Run primary llama-bench command Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-15-qwen-ds4-vs-llamacpp.md Executes the standard benchmark configuration using Metal autofit and mmap. ```sh ./llama-bench \ -m "$MODEL" -p 32 -n 8 -r 1 -t 8 \ -ngl -1 -fa auto -mmp 1 --progress ``` -------------------------------- ### Execute Metal Flash One-shot CLI Source: https://github.com/andreaborio/hebrus/blob/main/QA_BEFORE_RELEASES.md Run a single prompt using the DeepSeek Flash model with specific context and thinking parameters. ```bash ./ds4 -m "$DEEPSEEK_V2" --ctx 32768 --nothink -p "Explain C pointers in one paragraph." ``` -------------------------------- ### Runtime Steering Options Source: https://github.com/andreaborio/hebrus/blob/main/dir-steering/README.md Command-line arguments for configuring directional steering during model execution. ```text --dir-steering-file FILE load a 43 x 4096 f32 direction file --dir-steering-ffn F apply steering after FFN outputs; default is 1 when a file is provided --dir-steering-attn F apply steering after attention outputs; default is 0 ``` -------------------------------- ### Run llama.cpp CLI inference Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-15-qwen-ds4-vs-llamacpp.md Executes the llama.cpp CLI with parameters matching the DS4 benchmark configuration. ```sh MODEL=/absolute/path/to/Qwen3.6-35B-A3B-ds4-Q4_K_S.gguf /usr/bin/time -l ./llama-cli \ -m "$MODEL" -c 160 -n 96 -t 18 -tb 18 \ -ngl all -fa on -b 64 -ub 64 \ --conversation --single-turn --reasoning off \ -sys 'You are a helpful assistant' \ -p 'Scrivi solo codice Python: una funzione fibonacci(n) iterativa, con validazione per n negativo.' \ --temp 0 --top-k 0 --top-p 1 --min-p 0 -s 1 \ --no-display-prompt -co off --show-timings ``` -------------------------------- ### Download and Run Qualified Model Source: https://github.com/andreaborio/hebrus/blob/main/docs/releases/v0.2.0.md Use the provided shell script to download a versioned model artifact and execute it with the ds4 binary without additional tuning flags. ```sh ./download_model.sh qwen-v2 ./ds4 -m gguf/Qwen3.6-35B-A3B-DS4-ExpertMajor-v2-Q4_K_S.gguf \ --ctx 8192 -p "Hello" ``` -------------------------------- ### Execute Model Benchmarks and Runs Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-20-agent-friendly-refactor-validation.md Commands used to run model benchmarks and inference on the Metal runtime, utilizing specific environment variables and configuration flags. ```sh ./build/metal-arm64/bin/ds4-bench -m "$QWEN_V2" --metal --resident \ --power 100 -t 8 --prompt-file speed-bench/promessi_sposi.txt \ --ctx-start 2048 --ctx-max 2048 --step-mul 2 --gen-tokens 16 \ --csv "$QWEN_RESULT" --dump-decode-evidence-dir "$QWEN_EVIDENCE" DS4_M5_MODEL="$DEEPSEEK_V2" DS4_M5_PREFIX="$DEEPSEEK_PREFIX" \ DS4_M5_CTX_START=128 DS4_M5_CTX_MAX=128 DS4_M5_CTX_ALLOC=32768 \ DS4_M5_PRELOAD_EXPERTS=4096 \ speed-bench/run_m5_dsflash_arm.sh final-adaptive-4387 auto 256 ./build/metal-arm64/bin/ds4 -m "$GLM_V2" --ctx 8192 \ --prompt-file /tmp/glm-prefill-288-exact.txt --temp 0 -n 32 ``` -------------------------------- ### Run Hebrus Benchmark Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Executes a performance benchmark on a specified GGUF model using a prompt file and defined context parameters. ```sh ./hebrus-bench \ -m /absolute/path/to/QUALIFIED-DEEPSEEK-FLASH-DS4-ExpertMajor-v2.gguf \ --prompt-file speed-bench/promessi_sposi.txt \ --ctx-start 2048 \ --ctx-max 65536 \ --step-incr 2048 \ --gen-tokens 128 ``` -------------------------------- ### Verify Dataset Generation Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/imatrix/dataset/README.md Runs the dataset builder in check mode to verify deterministic generation without creating persistent artifacts. ```sh python3 gguf-tools/imatrix/dataset/build_ds4_imatrix_dataset.py --check ``` -------------------------------- ### Execute DeepSeek V4 Flash Benchmark Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-14-m5-pro.md Command to run the ds4-bench binary with specific SSD-streaming and cache configurations for performance testing. ```sh BIN=/path/to/checked-out-build/metal-arm64/bin/ds4-bench MODEL=/path/to/DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix.gguf OUT=/tmp/ds4-ab-leg "$BIN" --metal --ssd-streaming \ --ssd-streaming-cache-experts 3000 \ --ssd-streaming-preload-experts 3000 \ -m "$MODEL" \ --prompt-file tests/long_context_security_prompt.txt \ --ctx-start 128 --ctx-max 128 --ctx-alloc 32768 \ --gen-tokens 256 \ --dump-frontier-logits-dir "$OUT.logits" \ --csv "$OUT.csv" ``` -------------------------------- ### Execute Project Tests Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Runs the full test suite and specific logprob vector validations using the C runner. ```sh DS4_TEST_MODEL=/absolute/path/to/QUALIFIED-DEEPSEEK-FLASH-DS4-ExpertMajor-v2.gguf make test DS4_TEST_MODEL=/absolute/path/to/QUALIFIED-DEEPSEEK-FLASH-DS4-ExpertMajor-v2.gguf ./ds4_test --logprob-vectors ./ds4_test --server ``` -------------------------------- ### List evaluation tools Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/imatrix/README.md Paths to local tools used for evaluating GGUF model variants. ```text misc/quant_eval.c gguf-tools/quality-testing/ ``` -------------------------------- ### Test Command Aliases Source: https://github.com/andreaborio/hebrus/blob/main/QA_BEFORE_RELEASES.md Verifies that profile commands are correctly symlinked to the main binary. ```bash make command-alias-test ``` -------------------------------- ### Run Multi-Frontier Benchmark Sweep Source: https://github.com/andreaborio/hebrus/blob/main/speed-bench/README.md Executes a series of benchmarks across different context sizes to explore performance curves. ```bash for frontier in 128 2048 8192 32768; do ./hebrus-bench \ -m /absolute/path/to/qualified-model.gguf \ --prompt-file speed-bench/promessi_sposi.txt \ --ctx-start "$frontier" --ctx-max "$frontier" \ --ctx-alloc 65536 --gen-tokens 128 \ --csv "/tmp/hebrus-$frontier.csv" \ --dump-decode-evidence-dir "/tmp/hebrus-$frontier-evidence" done ``` -------------------------------- ### Run hebrus-eval benchmark Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Executes the benchmark with a specified GGUF model and trace file output. ```sh ./hebrus-eval \ -m /absolute/path/to/QUALIFIED-DEEPSEEK-FLASH-DS4-ExpertMajor-v2.gguf \ --trace /tmp/ds4-eval.txt ``` -------------------------------- ### Collect Activation Statistics Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/README.md Run the Hebrus runtime to collect activation statistics from the calibration corpus. ```sh ./hebrus \ -m gguf/DeepSeek-V4-Flash-Q4KExperts-F16HC-F16Compressor-F16Indexer-Q8Attn-Q8Shared-Q8Out-chat-v2.gguf \ --imatrix-dataset gguf-tools/imatrix/dataset/rendered_prompts.txt \ --imatrix-out gguf/DeepSeek-V4-Flash-chat-v2-routed-moe-ds4.dat \ --ctx 32768 ``` -------------------------------- ### Build and Inspect Hebrus Engine Source: https://github.com/andreaborio/hebrus/blob/main/README.md Compile the engine from source and verify its capabilities using the built-in info flags. ```sh git clone https://github.com/andreaborio/hebrus.git cd hebrus make -j ./hebrus --build-info ./hebrus --capabilities=json ``` -------------------------------- ### Verify Scalar GDN and Attention Fixtures Source: https://github.com/andreaborio/hebrus/blob/main/tests/qwen/README.md Runs deterministic checks for scalar GDN, attention fixtures, and the V-tiling contract. ```sh python3 tests/qwen/collect_gdn_reference.py --check python3 tests/qwen/collect_attention_reference.py --check python3 tests/qwen/test_v_tiling_contract.py ``` -------------------------------- ### Run safety and correctness benchmark lane Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-28-qwen-q2-k-xl-performance-weight.md Executes the initial short-context benchmark lane to verify system stability and correctness under SSD streaming mode. ```sh ./hebrus-bench --metal -m "$QWEN_Q2_V2" \ --ssd-streaming --ssd-streaming-cold \ --prompt-file tests/long_context_security_prompt.txt \ --ctx-start 128 --ctx-max 128 --ctx-alloc 8192 \ --step-mul 1 --gen-tokens 8 \ --dump-frontier-logits-dir /absolute/private/path/qwen-q2-16g-p128 \ --dump-decode-evidence-dir /absolute/private/path/qwen-q2-16g-p128 \ --csv /absolute/private/path/qwen-q2-16g-p128.csv ``` -------------------------------- ### Build Direction Vector Source: https://github.com/andreaborio/hebrus/blob/main/dir-steering/README.md Command to generate a steering direction file from paired prompt sets. ```sh python3 dir-steering/tools/build_direction.py \ --ds4 ./hebrus \ --model deepseek-v4-flash.gguf \ --good-file dir-steering/examples/succinct.txt \ --bad-file dir-steering/examples/verbose.txt \ --out dir-steering/out/verbosity.json \ --component ffn_out \ --ctx 512 ``` -------------------------------- ### POST /v1/chat/completions Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md OpenAI-compatible chat completion endpoint. ```APIDOC ## POST /v1/chat/completions ### Description Generates chat completions using OpenAI-style parameters. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **messages** (array) - Required - The conversation history. - **max_tokens** (integer) - Optional - Maximum tokens to generate. - **temperature** (float) - Optional - Sampling temperature. - **stream** (boolean) - Optional - Whether to stream the response. ``` -------------------------------- ### Execute a one-shot prompt Source: https://github.com/andreaborio/hebrus/blob/main/docs/glm52-expert-major-v2.md Run a single inference request by appending a prompt to the standard execution command. ```sh ./hebrus \ -m /absolute/path/to/GLM-5.2-DS4-ExpertMajor-v2-Q2_K.gguf \ --ctx 8192 \ -p "Explain why locality matters in mixture-of-experts inference." ``` -------------------------------- ### Build, Inspect, and Verify GGUF Models Source: https://github.com/andreaborio/hebrus/blob/main/docs/deepseek-expert-major-v2.md Commands to inspect, build, and verify GGUF model files using the ds4-expert-major.py script. ```sh python3 gguf-tools/ds4-expert-major.py inspect CANONICAL.gguf python3 gguf-tools/ds4-expert-major.py build \ CANONICAL.gguf DEEPSEEK-DS4-EXPERT-MAJOR-V2.gguf python3 gguf-tools/ds4-expert-major.py verify \ CANONICAL.gguf DEEPSEEK-DS4-EXPERT-MAJOR-V2.gguf ``` -------------------------------- ### Enable I/O Overlap and Balanced Reads Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-17-deepseek-native-expert-major.md Environment variables to opt-in for I/O overlap and balanced expert record pread features for performance testing. ```sh DS4_METAL_ENABLE_DEEPSEEK_PREFILL_IO_OVERLAP=1 ./ds4-bench ... DS4_METAL_ENABLE_BALANCED_EXPERT_RECORD_PREAD=1 ./ds4-bench ... ``` -------------------------------- ### Flash SSD Streaming Execution Source: https://github.com/andreaborio/hebrus/blob/main/QA_BEFORE_RELEASES.md Command to initiate flash streaming with specified model and cache experts. ```bash ./ds4 -m "$DEEPSEEK_V2" --ssd-streaming --ssd-streaming-cache-experts 32GB -p "..." ``` -------------------------------- ### View macOS Build Artifact Structure Source: https://github.com/andreaborio/hebrus/blob/main/GOLD_METAL_SSD.md Displays the directory structure for separated Metal and CPU build artifacts. ```text build/metal-/{obj,bin} build/cpu-/{obj,bin} ``` -------------------------------- ### Run SSD Streaming with Expert Cache Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Executes the Hebrus engine with SSD streaming enabled, a specified expert cache budget, and a defined context window. ```sh ./hebrus \ -m /absolute/path/to/QUALIFIED-DEEPSEEK-FLASH-DS4-ExpertMajor-v2.gguf \ --ssd-streaming \ --ssd-streaming-cache-experts 32GB \ --ctx 32768 \ --nothink ``` -------------------------------- ### Pack and Verify Native GGUF Artifacts Source: https://github.com/andreaborio/hebrus/blob/main/docs/releases/v0.1.0.md Use these commands to convert a source GGUF into a native DS4 expert-major format and verify the integrity of the resulting output. ```sh make ds4-qwen-pack ./ds4-qwen-pack native SOURCE.gguf SOURCE.experts.pack OUTPUT.gguf ./ds4-qwen-pack verify-native SOURCE.gguf OUTPUT.gguf ``` -------------------------------- ### Reproduce Merge and Sync Process Source: https://github.com/andreaborio/hebrus/blob/main/MERGE_LOG.md Commands to synchronize the local branch with upstream, resolve conflicts by prioritizing upstream streaming, and re-apply specific non-streaming fork features. ```sh git checkout -b sync-fix main git merge upstream/main git checkout --theirs ds4.c && git add ds4.c && git commit # take upstream streaming # re-apply only the non-streaming fork hunks (profile + prune + imatrix), NOT streaming: git diff 8384adf main -- ds4.c | | git apply --3way make && DS4_TEST_SSD_STREAMING=1 ./ds4_test --streaming-decode-prefill-correctness # must == main ``` -------------------------------- ### Display evaluation results Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/imatrix/README.md Performance metrics comparing the old Q4 model against the Q4 imatrix model. ```text old Q4 avg NLL: 0.177357819 Q4 imatrix avg NLL: 0.173895148 relative NLL change: -1.95% case wins: 54 imatrix / 46 old first-token matches: 83 imatrix / 81 old avg greedy LCP: 12.21 imatrix / 11.94 old ``` -------------------------------- ### Validate Capabilities Source: https://github.com/andreaborio/hebrus/blob/main/QA_BEFORE_RELEASES.md Runs capability tests and validates schema versions and backend identity. ```bash make capabilities-test python3 tests/test_capabilities.py --bin-dir build/cpu-$(uname -m)/bin --backend cpu ``` -------------------------------- ### Benchmark Prompt Continuation Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-20-glm52-expert-major-v2.md The exact text continuation used for the deterministic benchmark evaluation. ```text The user wants me to complete the function. The function computes count, mean, and variance per numeric column using Welford's online algorithm. The return should ``` -------------------------------- ### --capabilities=json Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Retrieves the engine's capabilities and schema information in JSON format. ```APIDOC ## CLI Command: --capabilities=json ### Description Returns a deterministic JSON schema reporting the build revision, compiled backend, executable role, supported model families, and tensor/storage wire contracts. ### Usage ./hebrus --capabilities=json ### Response - **schema_version** (integer) - The version of the capability schema. - **engine_id** (string) - The identifier for the engine (e.g., "hebrus"). - **build_git_sha** (string) - The Git revision of the build. - **backend** (string) - The compiled backend (e.g., "metal" or "cpu"). - **executable_role** (string) - The role of the executable (e.g., "server", "cli", "agent"). - **model_families** (array) - List of supported model families. - **expert_major** (object) - Details regarding the ExpertMajor v2 tensor and storage wire contract. ### Response Example { "schema_version": 1, "engine_id": "hebrus", "build_git_sha": "", "backend": "metal", "executable_role": "server", "model_families": ["deepseek4", "glm-dsa", "qwen35moe"], "expert_major": { "version": 2, "tensor": "ds4.expert_major.v2", "storage_formats": [ {"id": "ggml", "wire_value": 0, "group_sizes": []}, {"id": "mlx-affine4", "wire_value": 1, "group_sizes": [64]} ] } } ``` -------------------------------- ### Verify identity compatibility Source: https://github.com/andreaborio/hebrus/blob/main/docs/guides/MIGRATING_TO_HEBRUS.md Run these commands to compare build information and capabilities between ds4 and Hebrus. ```sh hebrus --build-info hebrus --capabilities=json ds4 --build-info ds4 --capabilities=json ``` -------------------------------- ### Run model-free tests Source: https://github.com/andreaborio/hebrus/blob/main/GOLD_METAL_SSD.md Executes build isolation and model-free tests that do not require downloading model files. ```sh make build-isolation-test make model-free-test ``` -------------------------------- ### Enable DeepSeek Expert Group Prefill Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-17-deepseek-native-expert-major.md Environment variable to explicitly enable the expert group prefill schedule for experiments. ```sh DS4_METAL_ENABLE_DEEPSEEK_EXPERT_GROUP_PREFILL=1 ./ds4-bench ... ``` -------------------------------- ### Run 8K context-sensitive benchmark lane Source: https://github.com/andreaborio/hebrus/blob/main/docs/benchmarks/2026-07-28-qwen-q2-k-xl-performance-weight.md Executes the 8K context-sensitive benchmark lane to evaluate performance and memory pressure under higher load. ```sh ./hebrus-bench --metal -m "$QWEN_Q2_V2" \ --ssd-streaming --ssd-streaming-cold \ --prompt-file tests/long_context_security_prompt.txt \ --ctx-start 8192 --ctx-max 8192 --ctx-alloc 8321 \ --step-mul 1 --gen-tokens 128 \ --dump-frontier-logits-dir /absolute/private/path/qwen-q2-16g-p8k \ --dump-decode-evidence-dir /absolute/private/path/qwen-q2-16g-p8k \ --csv /absolute/private/path/qwen-q2-16g-p8k.csv ``` -------------------------------- ### Calibration Dataset Output Path Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/imatrix/README.md The path to the generated file containing Hebrus-rendered chat prompts. ```text gguf-tools/imatrix/dataset/rendered_prompts.txt ``` -------------------------------- ### Score and compare GGUF models Source: https://github.com/andreaborio/hebrus/blob/main/CONTRIBUTING.md Run the scoring tool on old and new GGUF files, then compare the results using the provided Python script. ```sh gguf-tools/quality-testing/score_official OLD.gguf \ gguf-tools/quality-testing/data/manifest.tsv /tmp/old.tsv 4096 gguf-tools/quality-testing/score_official NEW.gguf \ gguf-tools/quality-testing/data/manifest.tsv /tmp/new.tsv 4096 python3 gguf-tools/quality-testing/compare_scores.py /tmp/old.tsv /tmp/new.tsv ``` -------------------------------- ### Generate Imatrix Dataset Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/imatrix/dataset/README.md Executes the dataset builder script to generate prompts for activation statistics. ```sh python3 gguf-tools/imatrix/dataset/build_ds4_imatrix_dataset.py ``` -------------------------------- ### Repack MLX Affine Artifacts Source: https://github.com/andreaborio/hebrus/blob/main/docs/qwen-expert-major-store.md Commands to build the base model and repack it with an MLX affine payload. ```sh python3 gguf-tools/ds4-expert-major.py build \ CANONICAL-QWEN.gguf QWEN-HEBRUS-EXPERT-MAJOR-V2.gguf python3 gguf-tools/ds4-expert-major.py repack-mlx-affine \ QWEN-HEBRUS-EXPERT-MAJOR-V2.gguf \ /path/to/mlx-community-Qwen3.6-35B-A3B-4bit \ Qwen3.6-35B-A3B-Hebrus-ExpertMajor-v2-MLX-Affine4-G64.gguf ``` -------------------------------- ### Build Hebrus ExpertMajor v2 GGUF Source: https://github.com/andreaborio/hebrus/blob/main/gguf-tools/README.md Commands to inspect, build, and verify a GGUF model for the ExpertMajor v2 format. ```python python3 gguf-tools/ds4-expert-major.py inspect MODEL.gguf python3 gguf-tools/ds4-expert-major.py build \ MODEL.gguf MODEL-DS4-ExpertMajor-v2.gguf python3 gguf-tools/ds4-expert-major.py verify \ MODEL.gguf MODEL-DS4-ExpertMajor-v2.gguf ``` -------------------------------- ### Run metal SSD streaming cache pressure test Source: https://github.com/andreaborio/hebrus/blob/main/tests/test-vectors/README.md Executes a specific test case for issue #384 using a GGUF model and cache pressure settings. ```sh DS4_TEST_MODEL=gguf/DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix.gguf \ ./ds4_test --metal-ssd-streaming-cache-pressure ``` -------------------------------- ### Build the Hebrus Engine Source: https://github.com/andreaborio/hebrus/blob/main/docs/ENGINE_REFERENCE.md Compile the engine for either Metal-accelerated macOS execution or CPU-only diagnostics. ```sh make # macOS Metal make cpu # CPU-only diagnostics in build/cpu-/bin on macOS ``` -------------------------------- ### Update command execution Source: https://github.com/andreaborio/hebrus/blob/main/docs/guides/MIGRATING_TO_HEBRUS.md Replace ds4-server with hebrus-server in existing automation scripts. ```diff --- before +++ after -exec ds4-server -m "$MODEL" --ctx 8192 +exec hebrus-server -m "$MODEL" --ctx 8192 ``` -------------------------------- ### Inspect local top-logprob dump Source: https://github.com/andreaborio/hebrus/blob/main/tests/test-vectors/README.md Command to manually inspect logprobs by running the hebrus executable with specific flags. ```sh ./hebrus --metal --nothink -sys "" --temp 0 -n 4 --ctx 16384 \ --prompt-file tests/test-vectors/prompts/long_code_audit.txt \ --dump-logprobs /tmp/long_code_audit.hebrus.json \ --logprobs-top-k 20 ``` -------------------------------- ### Execute Build Isolation Test Source: https://github.com/andreaborio/hebrus/blob/main/GOLD_METAL_SSD.md Runs a verification test to ensure Metal and CPU builds remain isolated and correctly linked. ```sh make build-isolation-test ```