mattt/ollama-swift
A Swift client library for interacting with Ollama. Supports structured outputs, tool use, and vision models.
What it solves
This library provides a native Swift interface for the Ollama API, allowing developers to integrate local large language models directly into macOS applications without manually handling complex network requests.
How it works
It acts as a client that communicates with a running Ollama server. Developers use it to send prompts, manage chat history, stream responses in real-time, and execute tool calls. It supports advanced features like structured JSON outputs, model memory management, and "thinking" modes for reasoning-heavy tasks.
Who it’s for
It is designed for Swift developers building macOS applications (macOS 13+) who want to leverage local AI models for text generation, chat, embeddings, or decision-making tasks.
Highlights
- Full support for streaming text and chat responses.
- Tool calling capabilities for interacting with external services.
- Structured output support using JSON schemas.
- Fine-grained control over model memory usage with keep-alive settings.
- Built-in support for generating embeddings and managing model files (pull/push/list).
- Support for "thinking" models that show reasoning processes.
Related
- Project
- Project
- Project
- Dispatch
- Project