πŸœ‚ Native Apple Silicon macOS Client

Browse HF Hub. Run Locally.
Zero Cloud Dependency.

The thin, honest macOS front-end for Hugging Face. Driven by Osaurus for MLX local inference with zero telemetry, real tokens/sec, and dual window/menu-bar interface.

v0.5.0 Β· notarized & stapled Β· Apple Silicon (arm64) Β· macOS 14 Sonoma+

hf.app Widescreen Flagship Header Visual

Engineered for On-Device Excellence

Real native macOS app performance with complete data sovereignty and instant accessibility.

⚑

Apple Silicon Native

Runs seamlessly on M1/M2/M3/M4 unified memory architectures via Osaurus engine for maximum throughput.

πŸ€—

Live HF Hub Search

Instant model discovery across Hugging Face Hub repositories with model metadata, tags, and pull triggers.

πŸœ‚

Dual Window & Agent UI

Work from a full workspace window or summon the quick prompt agent anytime directly from your macOS Menu Bar.

🧠

MoE Optimizer Layer

Intent classification (Code, Math, Summary, Creative) that dynamically routes prompts to specialized local models with expert system prompts.

♾️

entheai Memory Β· Preview

A native port of entheai's memory-pp engine β€” keeps the past raw and recalls the most relevant spans across sessions. On-device, deterministic, zero network.

πŸŽ™οΈ

Voice Β· Preview

Talk to your local model β€” on-device dictation and spoken replies via Apple-native speech, forced on-device. The liquid-rust / kokoro engines slot in next.

100% Private

Your Weights, Your Memory, Your Mac

`hf.app` acts as an honest interface layer. It never embeds bulky weights or runs heavy background telemetry. Everything heavy is executed on-device by Osaurus on localhost:1337.

  • βœ“ Full offline functionality once models are pulled
  • βœ“ macOS Keychain integration for Hugging Face tokens
  • βœ“ Sandboxed network client architecture
100% Private Local AI Execution
Clean Separation

Data Flow & Architecture

Browse models on Hugging Face Hub β†’ pull into Osaurus β†’ chat locally using standard OpenAI-compatible `/v1` endpoints.

  • βœ“ MoEOptimizer.swift: Intent Classifier & Model Router
  • βœ“ Services.swift: HubClient & OsaurusClient APIs
  • βœ“ HFMacApp.swift: MainActor Observable AppState
  • βœ“ Views.swift: SwiftUI WindowGroup + MenuBarExtra
hf-mac Architecture & Data Flow Diagram
🧠 Intelligent Routing

MoE Optimizer Layer

Zero-latency prompt intent classification directly inside the Swift app. Automatically detects code, math/reasoning, summarization, or creative prompts and routes them to specialized local models.

  • βœ“ Code Expert: Swift, Rust, Python, HTML formatting
  • βœ“ Reasoning & Math Expert: Step-by-step logic framing
  • βœ“ Summarization & Creative Experts: Domain system prompts
  • βœ“ Dynamic Model Router: Matches active Osaurus model capabilities
MoE Optimizer Intent Classification & Routing
Always Accessible

Menu Bar Agent Assistant

Need a fast code snippet, translation, or summary? Hit your menu bar icon anytime to open the quick prompt window without interrupting your workflow.

  • βœ“ Lightweight floating popover window
  • βœ“ Instant context switching
  • βœ“ Shared state with main window
macOS Menu Bar Quick AI Assistant

Documentation & Setup Guide

Everything you need to run, build, and extend hf.app on your Mac.

Install in under a minute

1 Β· Get the app. Download the latest .dmg (v0.5.0), open it, and drag hf.app into Applications. It's Developer-ID signed & notarized, so it opens with no Gatekeeper warning β€” no xattr dance.

2 Β· Get the engine. Install Osaurus and start it on localhost:1337. hf.app is the thin front-end; Osaurus owns the weights, MLX, and serving.

3 Β· Pull & run. Pull a model in Osaurus (Llama, Qwen, Phi…), then hit Refresh in the Run tab of hf.app. Real tokens/sec, fully on-device β€” your HF token stays in the macOS Keychain.

Run from source (developers)

Needs the Xcode Command Line Tools. Builds with SwiftPM β€” no Xcode project required:

BASH
git clone https://github.com/8b-is/hf-mac.git cd hf-mac swift run

Swift codebase β€” Sources/HFMac/

Eight single-responsibility files, ~1,200 lines total. hf.app drives Osaurus for inference and embeds live Spaces β€” it never bundles weights or a model runtime. Read by layer:

Entry & Router
HFMacApp.swift @main App β€” WindowGroup + MenuBarExtra, holding the @Observable AppState the whole UI reads. 186 loc
MoEOptimizer.swift Mixture of Experts layer β€” prompt intent classifier (`ExpertDomain`) and intelligent local model auto-router. 90 loc
Data & services
Memory.swift entheai memory Β· preview β€” native port of entheai's memory-pp: keep the past raw, recall relevant spans by lexical overlap (the NativeMesh scorer). On-device, deterministic. 101 loc
VoiceEngine.swift voice Β· preview β€” on-device TTS (speak replies) + STT dictation via Apple-native Speech/AVFoundation, forced on-device. The liquid-rust/kokoro sidecars slot in behind this. 97 loc
Services.swift HubClient (HF Hub REST β€” model & Space search) and OsaurusClient (OpenAI /v1 chat + model pull), with the HubModel / HFSpace types. 291 loc
OfflineStore.swift Offline content on disk β€” full static-Space snapshots (playable with no network) and cached article HTML, under Application Support. 50 loc
Keychain.swift Wrapper for the two secrets β€” the HF token and the optional Osaurus key. Never written to disk in the clear. 37 loc
Interface
Views.swift The five tabs β€” Spaces, Articles, Models, Run, Yours β€” plus the menu-bar agent and settings. 520 loc
WebView.swift SpaceWebView β€” embeds a live Hugging Face Space (*.hf.space) so quantum games, Gradio, and static apps run on the desktop; caches visited assets. 40 loc
Theme.swift The pocoo.vaked.dev palette β€” near-black-blue ground, cyan accent, mono type β€” over native macOS glass materials. 40 loc

Mixture of Experts (MoE) Intent Classifier & Router

The MoEOptimizer module (Sources/HFMac/MoEOptimizer.swift) performs on-device intent classification before sending prompts to your local Osaurus server. It evaluates user input across five domain experts:

  • ⚑ Code Expert: Injects software engineering system prompts and routes to coder/qwen models.
  • πŸ“ Reasoning & Math Expert: Formats step-by-step reasoning instructions and routes to reasoning/r1 models.
  • πŸ“ Summarization Expert: Formats actionable bullet-point extraction instructions.
  • 🎨 Creative Writing Expert: Enhances creative storytelling and drafting prompts.
  • 🧠 General Expert: High-throughput, concise general responses.

How it Works

SWIFT β€” MoEOptimizer.swift
let route = MoEOptimizer.optimize( prompt: text, chatHistory: chat, availableModels: osaurusModels ) // route.domain β†’ classified ExpertDomain // route.recommendedModelID β†’ auto-routed Osaurus model // route.formattedMessages β†’ messages with expert system framing

Keychain & Entitlements Security

The app holds two secrets β€” your Hugging Face token and the optional Osaurus key β€” in the system Keychain via macOS Security.framework (kSecClassGenericPassword, service hf.app). Never written to disk in the clear. Full policy: SECURITY.md.

ENTITLEMENTS
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.network.client</key> <true/> </dict> </plist>

Build & run in Xcode

The Xcode project is generated from project.yml (XcodeGen) over the same Sources/HFMac β€” the .xcodeproj is git-ignored, so project.yml is the source of truth. Generate it, then open:

BASH
brew install xcodegen # once xcodegen generate # writes HFMac.xcodeproj open HFMac.xcodeproj # ⌘R to run Β· Product β–Έ Archive to package

Press ⌘R to run, or Product β–Έ Archive for a release build. The shared HFMac scheme is what both Xcode and Xcode Cloud use. Signing is automatic (Team 7CFQYBX575); for an unsigned local build add CODE_SIGNING_ALLOWED=NO to an xcodebuild invocation.

Ship it β€” notarized DMG & the Mac App Store

Two tracks, one codebase. Full runbook: APP_STORE.md Β· PUBLISHING.md.

β‘  Developer-ID DMG (OSS / direct download). Push a v* tag and GitHub Actions builds β†’ Developer-ID signs β†’ notarizes + staples β†’ cuts a Release. Runs on Blacksmith Apple-Silicon runners.

RELEASE β€” TAG TO SHIP
git tag v0.5.0 git push --tags # β†’ notarized .dmg on Releases

β‘‘ Mac App Store / TestFlight via Xcode Cloud with Apple-managed signing β€” no manual certs. The app record is live: hf.app, Apple ID 6794829098. Open the generated project, choose Product β–Έ Xcode Cloud, pick the HFMac scheme, and archive β†’ TestFlight. The ci_scripts/ hooks regenerate the project and stamp the build number automatically.