Home » AI » AnyDecisionModel gives Swift apps choices they can inspect
Posted in

AnyDecisionModel gives Swift apps choices they can inspect

Official AnyDecisionModel chess inspector showing a selected move and the model probability distribution over five position assessments.
Image: Mattt, decision inspector (cropped) (Apache 2.0).

Hugging Face’s October 29 announcement introduces AnyDecisionModel, a Swift package for applications that need a decision rather than a generated reply. A support tool can ask which department should receive a ticket and get a typed choice with probabilities for the alternatives. The useful change is what the application can inspect before acting, instead of extracting a label from a paragraph.

The package separates a model from a session containing text or JSON. Each question refers to that same immutable state; an earlier answer does not become evidence for the next question. Developers can request a yes-or-no probability, choose among named options, or score something on an ordered scale. A batch preserves the order of the questions without making those questions a conversation.

That distinction suits routing work. The project’s example defines billing, technical and sales as Swift enumeration cases, so the selected department can flow into an exhaustive switch. Probabilities remain available alongside the chosen value. Application code can inspect alternatives rather than treating every successfully parsed answer as equally decisive.

The mechanism depends on the backend. With the ordinary MLX path, each allowed answer receives a one-token label. The model evaluates the prompt and the package reads the probabilities of those labels, rather than asking it to generate an explanation. This limits a choice to 26 options and a score to 10 levels. Those limits belong to this label-based approach, not to every model the package supports.

The chess example exposes the boundary of a choice

Mattt’s companion examples repository makes that limit visible in a chess app. When a position has more than 26 legal moves, the app first chooses within groups and then selects among the group winners. Its inspector displays those groups separately because probabilities from separate questions do not form one distribution. Combining them into a single ranking would conceal how the choices were produced.

The featured image is a cropped view of that official inspector. Its position assessment and selected move illustrate the application’s output; the displayed time and percentages are example values, not SekaiTech measurements or evidence of playing strength. The example’s rule engine supplies legal moves, while the model selects among them. That division is more informative than describing the demo as a general chess engine benchmark.

A second local route uses a trained decision head. AnyDecisionModel supports Cloudflare’s Clef joint-schema head through MLX, reading decisions from that head instead of next-token labels. The documentation says this route has no corresponding limit on option or scale length. Its current backend accepts text and JSON states, even though the underlying Clef model can also process images and video. A model’s capabilities and a particular wrapper’s supported inputs are different boundaries.

Backend choice also changes deployment. The package offers MLX, MLX decision heads, Core AI, llama.cpp, Jev and Ollama. Without optional package traits, developers get the core types and the Jev and Ollama clients without third-party dependencies; that subset also builds on Linux. Local backends have additional requirements. This is a Swift integration layer with several execution routes, not one bundled model that runs identically everywhere.

Confidence describes concentration, not correctness

The README explicitly warns that local choice and score confidence measures how concentrated the probability distribution is. A model can concentrate on the wrong answer. Jev and other System One servers calculate confidence differently, so their values should not be compared directly with local-backend values. A shared result type does not make the scores interchangeable.

The package provides calibration controls and optional rotation of answer positions to address different problems. Calibration fits probabilities to separate data; rotation averages results across different option orders and adds prompt evaluations. Neither supplies an application-specific error rate automatically. SekaiTech reviewed the announcement and repositories without running model inference, calibration experiments or the demo apps.

This adds another local-model integration choice alongside Ollama’s speech-model interfaces. For decision workloads, the first useful comparison is whether the same labeled cases produce acceptable routing errors under each backend, with their confidence definitions kept separate. The examples repository includes evaluation tools, but also discloses that its routing and robustness labels have not received human review. Those fixtures can help explore the API; they do not establish a production routing policy.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *