A correctness, consumability, and Swift 6 readiness release. Source-compatible with 4.1.0 (additive only). Validated end-to-end on Linux (curl streaming path) and macOS (native URLSession streaming path); 98 tests pass on both.
Highlights
- Consumers unblocked — removed
.unsafeFlagsfrom the library target, which previously prevented Swollama from being used as a versioned (from:) dependency at all. - Six streaming bugs fixed — dropped final chunk, fabricated
200, a 300s hard cap, dropped auth headers, 64KB buffering on Apple platforms, and cancellation leaks. Stalled connections are now bounded and torn down promptly. - Authentication —
OllamaConfiguration.apiKeysendsAuthorization: Beareron every request (native + streaming), enabling authenticated and cloud hosts. - Robust errors — Ollama
{"error": ...}bodies are parsed (including mid-stream); newauthenticationFailed/rateLimitedcases; 429 honorsRetry-Afterwith exponential backoff. - Swift 6 readiness — public value types are
Sendable; the library builds clean under-strict-concurrency=complete. - API ergonomics —
generateText/chat/generateEmbeddingsonOllamaProtocol; non-streamingcompleteText/completeChat; genericAsyncSequence.collect();OllamaModelNamegainsHashable/Equatable/CustomStringConvertible. - Platforms — now also declares tvOS 17, watchOS 10, visionOS 1.
- CLI — one-shot chat (
swollama chat <model> "prompt"or piped stdin),OLLAMA_HOST/OLLAMA_API_KEY, stderr-clean pipeable output,NO_COLOR/TTY color gating. - CI — build, test, formatting, and a strict-concurrency gate on the free
ubuntu-latestrunner.
See CHANGELOG.md for the full list.