Skip to content

4.2.0

Latest

Choose a tag to compare

@guitaripod guitaripod released this 20 Jul 16:16

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 .unsafeFlags from 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.
  • AuthenticationOllamaConfiguration.apiKey sends Authorization: Bearer on every request (native + streaming), enabling authenticated and cloud hosts.
  • Robust errors — Ollama {"error": ...} bodies are parsed (including mid-stream); new authenticationFailed / rateLimited cases; 429 honors Retry-After with exponential backoff.
  • Swift 6 readiness — public value types are Sendable; the library builds clean under -strict-concurrency=complete.
  • API ergonomicsgenerateText/chat/generateEmbeddings on OllamaProtocol; non-streaming completeText/completeChat; generic AsyncSequence.collect(); OllamaModelName gains Hashable/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-latest runner.

See CHANGELOG.md for the full list.