Skip to content

Hunch 0.2.0

Choose a tag to compare

@Mpdreamz Mpdreamz released this 28 Oct 13:10
· 1 commit to main since this release
d8965ac

Hunch answers typed questions about a piece of text (pick one of some options, place it on a scale, say how likely a statement is) in one forward pass of a small encoder, on Apple silicon, without a server, Python or a network call at inference time. It runs Laya checkpoints with MLX Swift.

This is Hunch's first release. Tags 0.1.0 to 0.1.2 belong to laya-mlx-swift, which Hunch forks.

.package(url: "https://github.com/heed-build/hunch", from: "0.2.0")

What changed from laya-mlx-swift

  • The library is Hunch, with a Question / Answer / DecisionModel API (choice, score, noul)
  • Special tokens come from the tokenizer config, which fixes wrong answers on the multilingual checkpoint
  • Temperatures are clamped to [0.5, 5]; calibration files and per-language temperatures load
  • A too-long state can keep its end (Truncation.keepEnd); an empty state adds no tokens
  • MLX errors are thrown instead of ending the process; inference runs on a queue of its own; unload() frees the weights
  • Checkpoints download from their origin (convaiinnovations/laya, convaiinnovations/laya-multilingual) at pinned revisions, every file checked by sha256, and an existing directory is never deleted
  • TerminalText.clean prepares terminal screens for questions about them
  • The README covers requirements, limits, and how an app built with SwiftPM ships MLX's Metal shaders

Requirements

macOS 14 or later on Apple silicon; Xcode 26 or later with the Metal toolchain to build (xcodebuild -downloadComponent MetalToolchain). The English checkpoint is about 807 MiB on disk and peaks near 1.8 GB in memory.

License

Apache-2.0. Hunch is a fork of MstyAI/laya-mlx-swift and follows laya-mlx; the model, prompt format and calibration method are Laya's, by Convai Innovations and the Laya contributors. Their notices are in NOTICE, dependency notices in THIRD_PARTY_NOTICES.md. This repository contains no model weights or tokenizer files. Hunch is not affiliated with or endorsed by Convai Innovations or the Laya project.