Skip to content

1.4.0

Choose a tag to compare

@mattt mattt released this 18 Nov 14:44
Immutable release. Only release title and notes can be modified.
810efa3

Important

The Llama trait now requires llama.swift 3.0.0, which wraps llama.cpp v1.0.0. If another package in your app depends on llama.swift, it needs a requirement that allows 3.0.0 (#428).
LlamaLanguageModel accepted each sampled token twice, so the frequency penalty counted each one twice, and every penalty looked back half as far as repeatLastN asks. That's fixed, so the same seed can now give different text than it did in 1.3.0, including with the default repeat penalty (#429).

This release lets LlamaLanguageModel load a GGUF model from the Hugging Face Hub by model ID, as MLXLanguageModel already does. init(modelId:file:mmproj:hub:gpuLayers:) takes the same string as llama.cpp's -hf option, such as ggml-org/gemma-3-4b-it-GGUF:Q4_K_M, picks the files with llama.cpp's rules, and downloads them into the shared Hugging Face cache. localModelPath replaces modelPath, which is deprecated, and prewarm now loads the model (#420).

The llama.cpp backend also has several fixes. It frees its models before the process exits, which works around an abort in llama.cpp's Metal backend; the README lists the cases it can't cover (#422). logLevel no longer races with llama.cpp's own logging: the default .warn applies from the first load, and .none now writes nothing (#421). A new session no longer reuses the KV cache of a freed session (#423). Mirostat v1 gets the vocabulary size instead of the context size (#429). On macOS with ffmpeg on PATH, WebP image data is now decoded as an image (#428).

OllamaLanguageModel has a new initializer that takes an apiKey, for Ollama's cloud (#414). OpenAILanguageModel, OpenResponsesLanguageModel, and OllamaLanguageModel send no Authorization header for an empty key, for servers that take none (#417, #418). AnthropicLanguageModel keeps an empty thinking signature and replays it, so multi-turn sessions work against llama-server's /v1/messages (#425).

Thanks to @akbashev for the Ollama API key (#414) and the empty-key fix (#417).

What's Changed

  • Send an API key with Ollama's requests, as Ollama's cloud asks by @akbashev in #414
  • Add an example of Ollama's cloud to the README by @mattt in #415
  • Send no Authorization for an empty key to a server compatible with OpenAI, and pin each provider's request headers by @akbashev in #417
  • Send no Authorization to Ollama for an empty key by @mattt in #418
  • Install the llama.cpp log callback once by @mattt in #421
  • Save CI caches only from main and allow 30 minutes for macOS tests by @mattt in #424
  • Replay thinking that a compatible server signs with an empty signature by @mattt in #425
  • Match a cached llama.cpp context only to its live session by @mattt in #423
  • Load GGUF models from the Hugging Face Hub by model ID by @mattt in #420
  • Free llama.cpp models before the process exits by @mattt in #422
  • Test the remote backends against llama-server by @mattt in #426
  • Make the CI caches smaller by @mattt in #427
  • Update llama.swift to llama.cpp 1.0.0 by @mattt in #428
  • Fix sampler accepts and the Mirostat vocabulary size in LlamaLanguageModel by @mattt in #429
  • Bump README install snippets to 1.4.0 by @mattt in #430

Full Changelog: 1.3.0...1.4.0