cagataycali/loopl

run agents on device, train your small model, offline first.

Swift

3

1 commits

updated Oct 8, 2026

See the code

README

loopl

loopl

Agents that run on the iPhone. A local model, the agent loop, and the phone's own abilities as tools — offline, no account, no cloud.

TestFlight Swift 6 iOS 18+ macOS 15+ loopl.dev

loopl on an iPhone 16 Pro: Qwen3-0.6B calls current_time and calculator, then answers. Nothing leaves the device.

Real capture · iPhone 16 Pro · Qwen3-0.6B, 4-bit, on device · 2× speed

Why

  • On the device. MLX, llama.cpp or Apple Foundation Models run the model. Prompts, tools and answers stay on the phone.
  • The phone is the toolbox. Image and voice generation, transcription, translation, vision, torch, haptics, deep links — one line hands them to the model.
  • A small, honest loop. Model → tools → model, until the model answers. Errors go back to the model; approvals pause the loop. Swift 6, Foundation only at the core.

Quickstart

.package(url: "https://github.com/cagataycali/loopl", from: "0.1.0")
import Loopl
import LooplRuntimes
import LooplAppleTools

let model = MLXModel()                                   // or GGUFModel(), AppleFoundationModel()
try await model.load(spec, from: weights) { _ in }

let agent = Agent(model: model, tools: AppleTools.available)   // what this iPhone can do
for try await event in agent.stream("Torch on, and how do I say 'where is the exit?' in Turkish?") {
    if case .text(let chunk) = event { print(chunk, terminator: "") }
}
Product
LooplAgent, Tool, Model, hooks, structured output, checkpoints, tracing — Foundation only
LooplRuntimesMLX (Metal, vision), llama.cpp (GGUF), Apple Foundation Models
LooplAppleToolsgenerate_image, generate_voice, transcribe, translate, describe_image, flashlight, vibrate, open_app
LooplUISwiftUI transcript, tool rows, approval card

Get started · Write a tool · API reference

The app

The SDK, shipped as a free iOS app. Everything below runs on the phone.

Chat: two tool calls with their arguments and results
Tools, shown. Every call, its arguments, its result.
Models: browse Hugging Face, train your own, your private models
Any model. The catalog, any Hugging Face repo, your private ones.
Train your own: a Hugging Face job post-tuning Qwen3.5 0.8B on 191 conversations
Your own model. Post-tune on your conversations.
  • Models — MLX and GGUF from Hugging Face; add a token to list and download your private repos.
  • Share — select conversations, push them to a private Hugging Face dataset.
  • Train your own — launch a Hugging Face job from the phone, see the cost first, get the model back in Models.
  • External drive — keep models on a USB-C drive when the phone is full.
  • Voice and vision — record with the mic and the model calls transcribe; attach a photo for vision models.
  • Tools — torch, haptics, open apps, image and voice generation, translation; risky calls ask first.

Get it on TestFlight

Models

ModelRuntime4-bitTool calls
Qwen3-0.6BMLX335 MB✓default
Qwen3-1.7BMLX968 MB✓41 tok/s on iPhone 16 Pro
Qwen3 1.7B · Q4_K_MGGUF1.11 GB✓33 tok/s on iPhone 16 Pro
Qwen3.5 2BMLX1.75 GB✓vision
loopl 4BMLX3.03 GB✓post-tuned for loopl · vision · public

Up to 4B at 4-bit fits an 8 GB iPhone. Any public MLX or GGUF repo loads the same way. All models →

The loopl models — Qwen3.5 0.8B/2B/4B post-tuned for this loop, vision kept, with their cards — are public, in one Hugging Face collection.

How it works

Model → tools → model, until the model answers. No iteration cap. A failed call returns to the model as an error result, so it can fix the call; a tool that needs approval pauses the loop until you answer. The agent loop →

Build from source

swift test                                                     # SDK, macOS
brew install xcodegen && xcodegen generate -s App/project.yml  # the app → App/LooplApp.xcodeproj
scripts/fetch-llama-xcframework.sh --with-sim                  # once, for GGUF

Docs

loopl.dev · Get started · The app · Models · FAQ · Changelog

Made by @cagataycali.

agents
mlx
on-device-ai
swift

cagataycali/loopl

run agents on device, train your small model, offline first.

Swift

3

1 commits

updated Oct 8, 2026

See the code

README

loopl

loopl

Agents that run on the iPhone. A local model, the agent loop, and the phone's own abilities as tools — offline, no account, no cloud.

TestFlight Swift 6 iOS 18+ macOS 15+ loopl.dev

loopl on an iPhone 16 Pro: Qwen3-0.6B calls current_time and calculator, then answers. Nothing leaves the device.

Real capture · iPhone 16 Pro · Qwen3-0.6B, 4-bit, on device · 2× speed

Why

  • On the device. MLX, llama.cpp or Apple Foundation Models run the model. Prompts, tools and answers stay on the phone.
  • The phone is the toolbox. Image and voice generation, transcription, translation, vision, torch, haptics, deep links — one line hands them to the model.
  • A small, honest loop. Model → tools → model, until the model answers. Errors go back to the model; approvals pause the loop. Swift 6, Foundation only at the core.

Quickstart

.package(url: "https://github.com/cagataycali/loopl", from: "0.1.0")
import Loopl
import LooplRuntimes
import LooplAppleTools

let model = MLXModel()                                   // or GGUFModel(), AppleFoundationModel()
try await model.load(spec, from: weights) { _ in }

let agent = Agent(model: model, tools: AppleTools.available)   // what this iPhone can do
for try await event in agent.stream("Torch on, and how do I say 'where is the exit?' in Turkish?") {
    if case .text(let chunk) = event { print(chunk, terminator: "") }
}
Product
LooplAgent, Tool, Model, hooks, structured output, checkpoints, tracing — Foundation only
LooplRuntimesMLX (Metal, vision), llama.cpp (GGUF), Apple Foundation Models
LooplAppleToolsgenerate_image, generate_voice, transcribe, translate, describe_image, flashlight, vibrate, open_app
LooplUISwiftUI transcript, tool rows, approval card

Get started · Write a tool · API reference

The app

The SDK, shipped as a free iOS app. Everything below runs on the phone.

Chat: two tool calls with their arguments and results
Tools, shown. Every call, its arguments, its result.
Models: browse Hugging Face, train your own, your private models
Any model. The catalog, any Hugging Face repo, your private ones.
Train your own: a Hugging Face job post-tuning Qwen3.5 0.8B on 191 conversations
Your own model. Post-tune on your conversations.
  • Models — MLX and GGUF from Hugging Face; add a token to list and download your private repos.
  • Share — select conversations, push them to a private Hugging Face dataset.
  • Train your own — launch a Hugging Face job from the phone, see the cost first, get the model back in Models.
  • External drive — keep models on a USB-C drive when the phone is full.
  • Voice and vision — record with the mic and the model calls transcribe; attach a photo for vision models.
  • Tools — torch, haptics, open apps, image and voice generation, translation; risky calls ask first.

Get it on TestFlight

Models

ModelRuntime4-bitTool calls
Qwen3-0.6BMLX335 MB✓default
Qwen3-1.7BMLX968 MB✓41 tok/s on iPhone 16 Pro
Qwen3 1.7B · Q4_K_MGGUF1.11 GB✓33 tok/s on iPhone 16 Pro
Qwen3.5 2BMLX1.75 GB✓vision
loopl 4BMLX3.03 GB✓post-tuned for loopl · vision · public

Up to 4B at 4-bit fits an 8 GB iPhone. Any public MLX or GGUF repo loads the same way. All models →

The loopl models — Qwen3.5 0.8B/2B/4B post-tuned for this loop, vision kept, with their cards — are public, in one Hugging Face collection.

How it works

Model → tools → model, until the model answers. No iteration cap. A failed call returns to the model as an error result, so it can fix the call; a tool that needs approval pauses the loop until you answer. The agent loop →

Build from source

swift test                                                     # SDK, macOS
brew install xcodegen && xcodegen generate -s App/project.yml  # the app → App/LooplApp.xcodeproj
scripts/fetch-llama-xcframework.sh --with-sim                  # once, for GGUF

Docs

loopl.dev · Get started · The app · Models · FAQ · Changelog

Made by @cagataycali.

agents
mlx
on-device-ai
swift