Repository navigation
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 thellama_token_*vocabulary functions. The Migrating from 2.x section of the README lists the replacement for each one. llama_context_paramsno longer hasdefrag_thold.mtmd_helper_bitmap_init_from_bufandmtmd_helper_bitmap_init_from_filetake a new last argument of typemtmd_helper_init_opt. Passmtmd_helper_init_opt_default()for the default.mtmd_helper_post_decode_callbackreceives aconst struct mtmd_helper_embd_batch *instead of astruct llama_batch.mtmd_gen_audio_processtakes a newmtmd_gen_state *second argument.mtmd_gen_inpno longer hasseed,state_data, orstate_size, andmtmd_gen_outno longer hasstate_dataorstate_size. Set the seed inmtmd_gen_state_params, and keep themtmd_gen_statefor 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_filereturnsfalse, andllama_state_seq_load_filereturns 0. State buffers fromllama_state_get_datacarry 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.