Skip to content

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 14 Oct 03:18
· 504 commits to main since this release
04ca5e1
  • Pair this release with Apple companions llamadart_llama_cpp_flutter
    0.0.22, llamadart_litert_lm_flutter 0.0.14 and
    llamadart_stable_diffusion_flutter 0.0.3, which link native runtimes
    v0.6.0-2, v0.18.0 and v0.2.0-3, respectively.

  • Behavior change: when the app, or any member of its pub workspace,
    depends on llamadart together with flutter_edge_ai_llama or
    flutter_edge_ai_litertlm, the native build hook bundles llama.cpp only
    unless llamadart_native_runtimes names litert_lm, and fails the build
    when litert_lm is named next to flutter_edge_ai_litertlm, which ships the
    same libraries (Alongside Flutter Edge AI).

  • On an iOS simulator, GpuBackend.auto now runs llama.cpp on the CPU, because Metal returns incorrect output there (#950). An explicit GpuBackend.metal or ComputeDevice.gpu still uses Metal and logs a warning; iOS devices and macOS are unchanged.

  • Android validation builds can retain bounded, identity-checked reports in app-private storage.

  • Clarify that native KV-state restoration does not guarantee identical next-token scores or continuation.

  • Portable validation launchers can use captured native logs for required GPU qualification.

  • Adopt native runtime v0.6.0-2 and image runtime v0.2.0-3 for cooperative application shutdown.

  • Shut down the Linux chat app’s Flutter engines before process exit, including active model work.

  • Wait for llama.cpp and image-generation workers to exit before disposal completes, including concurrent disposal calls.

  • Exclude Android Adreno 750 driver 2150604839 from llama.cpp Vulkan loads: automatic selection falls back to CPU with a warning, and an explicit GPU request throws instead of crashing or producing incorrect text.

  • Update the default LiteRT-LM runtime to
    leehack/litert-lm-native@v0.18.0 (upstream LiteRT-LM v0.18.0). On the
    macOS GPU backend the program cache of Qwen3 0.6B and Gemma 4 E2B no longer
    grows on every engine create; Qwen3.5 0.8B's still does
    (#552), and on the GPU
    backend that bundle can still return the prompt instead of an answer on
    later requests to one engine, as in 0.11
    (#672). The Windows
    bundle adds webgpu_dawn.dll, which the GPU accelerator now loads.

  • Behavior change: with LiteRT-LM v0.18.0, a ModelParams.chatTemplate
    on a Qwen 3 .litertlm text bundle receives each message's content as a
    list of {"type": "text", "text": ...} parts instead of a string. A
    template that concatenates content as a string fails the generation, and
    one that interpolates it renders the list into the prompt; read both shapes
    (Chat templates).
    The built-in templates are unaffected.

  • Qwen3 0.6B on the LiteRT-LM GPU of an Adreno 750 (Galaxy S24): with
    v0.18.0 GPU engine creation fails there, where v0.17.0-8 generated wrong
    text. The first use throws LlamaUnsupportedException under
    ComputeDevice.gpu and LlamaModelException under auto. Load that model
    with ComputeDevice.cpu, which works on the device; Gemma 4 E2B runs on
    that GPU (#553).

  • Behavior change: a LiteRT-LM engine the runtime cannot create under
    ComputeDevice.auto or ComputeDevice.cpu now throws LlamaModelException
    on first use. LlamaEngine.create, generate and complete threw
    LlamaInferenceException there, so a catch of that type no longer sees
    this failure; ChatSession, tokenize, detokenize, getTokenCount and
    chatTemplate with a token count threw a StateError. With v0.18.0 that
    includes a liteRtLmCacheDir the runtime cannot write, on the CPU backend
    too.

  • Fix a LiteRT-LM bundle named without .litertlm failing engine creation
    when the process cannot write the bundle's directory and liteRtLmCacheDir
    is unset, as on Linux: it now runs without runtime caches
    (#973).

  • LiteRT-LM release sync accepts runtimes built on upstream v0.17.1 and
    v0.18.0, and names the upstream version when its prebuilt-override table
    is behind the runtime owner's
    (#586).

  • Move the documented Web LiteRT-LM default from @litert-lm/core@0.15.0 to
    @litert-lm/core@0.18.0. An app still chooses the module through
    window.__llamadartLiteRtLmModuleUrl; the chat app's web/index.html and
    the docs now name 0.18.0.

  • Adopt leehack/stable-diffusion-native@v0.2.0-3 for the opt-in
    stable_diffusion image runtime.

  • Check the memory of Vulkan GPUs before loading an image model
    (stable-diffusion-native#9).
    On Linux ImageGenerationEngine.load refuses, with LlamaModelException,
    only a model that does not fit the discrete GPUs plus system memory. A
    model larger than the memory of the GPU that computes still loads, with
    one warning, and runs slower; on Windows it is warned about and never
    refused. Not validated on a physical Vulkan GPU yet;
    ImageModelParams(checkMemory: false) skips the check and the warning.

  • Quote the errors stable-diffusion.cpp logged in the LlamaModelException
    of an image model it cannot load, with files named by role
    (stable-diffusion-native#3).

  • Send the image runtime's messages to the LlamaLogging.configure handler
    at the configured levels, after each load and generation. The runtime no
    longer prints ggml's device messages to stderr: at the default level
    none it logs nothing.

  • Update the default llama.cpp runtime to
    leehack/llamadart-native@v0.6.0-2 (llama.cpp v0.6.0), and the
    llamadart_llama_cpp_flutter Apple SwiftPM pin with it.

  • Behavior change: a llama.cpp state file saved by llamadart 0.11.x or
    earlier no longer loads: llama.cpp v0.6.0 changed the session format.
    On native, stateLoadFile throws LlamaStateException naming the file's
    format version and the one the runtime reads; evaluate the prompt again and
    save a new file (Save and restore prompt state).

  • Fix a C++ exception inside llama.cpp ending the process on native. The
    failed call now throws the typed LlamaException of its operation with
    llama.cpp's message, such as LlamaInferenceException from detokenize
    for a token outside the vocabulary, or from a lazy-grammar trigger pattern
    that is not a regular expression. A context the failed call left undefined
    then throws LlamaStateException until its model is loaded again
    (llamadart-native#102).

  • Android llama.cpp Vulkan: the 8-token text-prompt decode cap now applies
    only on a GPU whose subgroup size llama.cpp v0.6.0 mis-tiles (16, or below
    8) or cannot be read. Other GPUs decode a text prompt in full micro-batches
    (#948).

  • llama.cpp Vulkan needs Vulkan 1.2 from the loader and the GPU driver. When
    the Vulkan GPU a load would run on reports less, ComputeDevice.gpu now
    throws LlamaUnsupportedException naming the GPU and both versions, and
    ComputeDevice.auto loads the model on the CPU with a warning, instead of
    starting a driver llama.cpp cannot use; a load with other usable GPUs
    leaves that one out
    (#782).

  • Aligned the default WebGPU bridge assets to v0.1.59: they embed llama.cpp
    v0.6.0, are qualified against native v0.6.0, and keep Web/native
    llama.cpp v0.6.0@d81235049384534c167caea52b85a694f6103d14 parity; Web
    LiteRT-LM is @litert-lm/core@0.18.0. Immutable Web asset manifest:
    f823b10417b212ff1f66aa1c46bf78af7d9c393497dfcf0fa3a4f77adeb260eb.
  • Behavior change: chat content keeps the whitespace that ends a reply,
    as llama.cpp's llama-server does. LlamaEngine.create, ChatSession and
    ChatTemplateEngine.parse trimmed it in every chat format except Gemma 4,
    so the text before a caller stop sequence lost a trailing space or newline:
    alpha before the stop cedar17 came back as alpha
    (#951). A reply the model
    ends with a newline now keeps it, as does a JSON-mode reply where the
    grammar allows whitespace after the value (createStructuredJson and
    LlamaStructuredOutput.parse still decode it); trim replies you compare
    exactly. ChatSession and its tool loop store assistant turns in history
    without that whitespace, so the next prompt is unchanged.
  • Fix a process abort on an image with more tokens than the context's
    micro-batch when the projector's images are decoded with non-causal
    attention (Gemma 3 and Gemma 4 other than E2B and E4B, among others): the
    prompt now throws LlamaInferenceException naming the
    ModelParams.microBatchSize it needs. With default batch sizes that is an
    image above 512 tokens. A context whose batch equals its micro-batch still
    decodes such an image in several batches, and now logs a warning that this
    can reduce accuracy
    (#958).
  • Behavior change: all in llamadart_native_runtimes now includes the
    opt-in stable_diffusion image runtime, so llamadart_native_runtimes: all
    ships GGUF, .litertlm and image generation together. An app that already
    sets all, or a list containing it, downloads 14.7 to 15.6 MB more per
    target, or 25.8 to 27.8 MB for the Vulkan build Linux and Windows use by
    default, and grows by about 37 MB as measured on macOS arm64 and Android
    arm64. android-x64 and Windows arm64 publish no image runtime and skip it
    with a warning. A Flutter iOS or macOS app skips it with a build warning
    unless llamadart_stable_diffusion_flutter is a dependency; a pub
    workspace member, whose user-defines live in the workspace root pubspec, is
    not recognised as one and bundles it. Leaving the key unset, or setting
    both, still bundles only llama_cpp and litert_lm
    (#856).
  • Behavior change: an image or audio part of a chat request to a GGUF
    model takes the place it has in its message, as llama.cpp's llama-server
    renders it (#964). For
    Qwen3.5 and Qwen2.5-Omni it was attached before the whole prompt, and for
    GLM-OCR it was wrapped in the image start and end tokens twice, so prompts
    for media turns of these models change. A chat template no longer writes
    its own text for a media part: Qwen's Picture N: under add_vision_id,
    the Kimi-K2 wrapper, Reka's run of image tokens and Cohere's
    <|IMG_PATCH|> are gone, as on llama-server. A placeholder string that
    a chat message quotes (<img>, <image>, [IMG], <__media__>) is text
    instead of a part. Where the runtime would still read such a string as a
    part, it reaches the model with a zero-width space (U+200B) after its
    first character, which the model may repeat in its answer: a quoted
    <__media__> in create on native; every placeholder the bridge
    rewrites in create on Web; and every placeholder generate reads in the
    prompt chatTemplate returns for messages with media and in create on
    a custom backend without BackendChatPromptGeneration, which
    package:llamadart/backend.dart now exports. A prompt written for
    generate keeps its placeholders, and chatTemplate output for messages
    without media is unchanged.
  • On native llama.cpp, image or audio input that the loaded projector has no
    encoder for throws LlamaUnsupportedException naming the encoder, where
    create and generate threw LlamaInferenceException. A chat template
    that raises or has invalid syntax throws LlamaInferenceException with the
    template's message instead of a raw Exception
    (#963).
  • Fix LiteRT-LM bundles whose own chat template reads message content as a
    string, such as Qwen3.5-0.8B_int8.litertlm builds from before September
    2026. With LiteRT-LM v0.18.0 a template that interpolates the content put
    a serialized [{"text": ..., "type": "text"}] list into every prompt, so
    repeated requests degraded sooner than with v0.17.0-8; one that
    concatenates it failed every request; one that only handles a string
    rendered empty messages. Native platforms now give such a template the text
    again. Not covered: Web, and templates in the runtime's single-turn
    is_appending_to_prefill form, for which a warning is logged
    (#991, Chat templates).