Skip to content

3.0.0

Latest

Choose a tag to compare

@mattt mattt released this 18 Nov 12:27
· 1 commit to main since this release
dc5b8cb

llama.swift 3.0.0 uses llama.cpp v1.0.0, with the XCFramework from nightly build b12359.

Important

This is a major release. llama.cpp v1.0.0 removes its deprecated API and changes its saved state formats, so code that built with 2.x may need changes.

Breaking changes

  • llama.cpp v1.0.0 removes 36 deprecated functions, including llama_load_model_from_file, llama_free_model, llama_new_context_with_model, llama_n_vocab, and the llama_token_* vocabulary functions. The Migrating from 2.x section of the README lists the replacement for each one.
  • llama_context_params no longer has defrag_thold.
  • mtmd_helper_bitmap_init_from_buf and mtmd_helper_bitmap_init_from_file take a new last argument of type mtmd_helper_init_opt. Pass mtmd_helper_init_opt_default() for the default.
  • mtmd_helper_post_decode_callback receives a const struct mtmd_helper_embd_batch * instead of a struct llama_batch.
  • mtmd_gen_audio_process takes a new mtmd_gen_state * second argument. mtmd_gen_inp no longer has seed, state_data, or state_size, and mtmd_gen_out no longer has state_data or state_size. Set the seed in mtmd_gen_state_params, and keep the mtmd_gen_state for the whole generation.
  • Several structs have new fields, so Swift code that calls a full memberwise initializer needs the new arguments.
  • Session files and sequence state files saved with 2.x don't load: llama_state_load_file returns false, and llama_state_seq_load_file returns 0. State buffers from llama_state_get_data carry no version, so don't restore one that 2.x saved.

Versioning

From this release on, llama.swift follows llama.cpp version releases instead of each nightly build. llama.cpp vX.Y.Z is llama.swift (X+2).Y.Z. The 2.x versions, which carried nightly build numbers, end at 2.10549.0.

Platforms

The upstream XCFramework has slices only for macOS and iOS devices, so builds for the iOS Simulator, tvOS, and visionOS fail. This has been true since ggml-org/llama.cpp#27252, and it also applies to the last 2.x releases.