Skip to content

Add the package localai_decisions_qwen35: the decision models based on Qwen3.5, with llama.cpp in Rust #721

Closed

Description

@jeromeetienne

Goal

Add a Rust package that runs the open decision models based on Qwen3.5 on the computer, with llama.cpp.

  • Package name: localai_decisions_qwen35
  • Folder: packages/experiments/localai_decisions_qwen35
  • It gives a Rust library that Heidrun can link, and a command line tool.
  • It runs on the processor by default. A build option adds the GPU (Metal, CUDA, or Vulkan).
  • It supports every decision model based on Qwen3.5 that llama.cpp supports, not only one model. The model is a parameter.

A decision model reads a text (the "state") and typed questions with their options. It returns a probability for each option, in one pass, and writes no text. The API is the System One API of Jev (TypeSafe).

Why llama.cpp

The main difficulty

The model (Qwen3.5, and the Clef layers) is in the library of llama.cpp (src/), so the Rust binding can load it. The decision part is only in the server of llama.cpp: tools/server/server-decision.cpp (about 800 lines). It builds the prompt from the state and the questions, and reads the probability of each option. The library does not export this part.

Choices:

  1. Write this part again in Rust, from server-decision.cpp.
  2. Compile server-decision.cpp with the library, and call it from Rust.
  3. Start the server of llama.cpp as a separate program, and send HTTP requests to /v1/systemone. This is the simplest, but it is not a linked library.

First test, before the package

One assumption can make this work impossible: the Rust binding llama-cpp-2 cannot give the values that the decision part needs (for example, the binding uses an older llama.cpp than the two pull requests above, or it hides the functions that the decision part calls). The first step proves or kills this assumption:

  1. Run llama serve -hf ggml-org/Kev-0.8B-GGUF on the processor, send the example request of the README of the server, and save the probabilities.
  2. Run the same request through the Rust binding, on the processor.
  3. Compare the two results, and measure the time on the processor.

Build the package only when the two results match.

Decision models based on Qwen3.5 with a GGUF file

All these files are on Hugging Face. The size is the size of the file Q8_0.

Model Parameters Size of Q8_0 Architecture in llama.cpp
ggml-org/Kev-0.8B-GGUF 0.75 billion 0.81 GB qwen35
ggml-org/vllm-d3-edge-GGUF 0.75 billion 0.81 GB qwen35
ggml-org/vllm-d3-lite-GGUF 1.0 billion 1.08 GB qwen35
ggml-org/vllm-d3-nano-GGUF 2.4 billion 2.55 GB qwen35
ggml-org/Kev-4B-GGUF 4.2 billion 4.48 GB qwen35
ggml-org/lev-GGUF 4.2 billion 4.48 GB qwen35
ggml-org/vllm-d3-mini-GGUF 4.8 billion 5.16 GB qwen35
ggml-org/Kev-9B-GGUF 9.0 billion 9.53 GB qwen35
ggml-org/vllm-d3-flash-GGUF 9.0 billion 9.53 GB qwen35
ggml-org/Bespoke-Nimble-9B-v3-GGUF 9.0 billion 9.53 GB qwen35
ggml-org/Clef-Flash-GGUF 9.1 billion 9.66 GB clef (Qwen3.5 and the Clef layers)
ggml-org/OpenJev-GGUF 26.9 billion 28.6 GB qwen35
ggml-org/vllm-d3-GGUF 26.9 billion 28.6 GB qwen35
ggml-org/Clef-GGUF 27.0 billion 28.73 GB clef (Qwen3.5 and the Clef layers)

Proposed default model: ggml-org/Kev-0.8B-GGUF, file Q8_0. It is the smallest, and its license is Apache 2.0.

Laya and Julia-1 also work with /v1/systemone, but their architecture is ModernBERT, not Qwen3.5, so they are not in this package.

Done when

  • The library and the command line tool run every model of the table on the processor, with a model given as a parameter.
  • A build option runs the same models on the GPU.
  • The package has a CONTEXT.md file and a README.md file.
  • The tests compare the results of the package with the results of the server of llama.cpp on the same requests, with Kev-0.8B.
  • The section "Tests" of AGENTS.md lists the command pnpm --filter localai_decisions_qwen35 test.

Not known yet

  • The speed of each model on the processor.
  • If the Rust binding llama-cpp-2 already has the two pull requests of llama.cpp above.
  • The image input of the models that have a file mmproj. This issue covers text only.

Related

Activity

  1. jeromeetienne commented on Oct 19, 2026

    @jeromeetienne
    ContributorAuthor

    Done in the pull request below, merged into dev_jerome with the commit 742471e. The 6 vllm-d3 models do not run yet: llama.cpp v0.6.0 does not have this decision type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions