Skip to content

Moss Android SDK v0.33.0

Choose a tag to compare

@moss-release-bot moss-release-bot released this 23 Nov 17:25
· 4 commits to main since this release
59eccaa

Moss Android SDK v0.33.0.

AAR: moss-android-0.33.0.aar (arm64-v8a, minSdk 24, namespace dev.usemoss.moss).

SHA-256: a535bb8675ec4544fab24f016ff3e625bd45e394272dd6cc112e885a68738c08

Added

  • ClientOptions, the new last argument of both MossClient constructors,
    has keepModels, off by default. With it on, each embedding model the client
    loads that the project's clients share stays loaded after the client closes,
    so the next client of the project in the app loads a cached index without
    opening the model again, once its own grant for the same artifact arrives,
    until the grant the model was opened under is within 30 seconds of expiring,
    at most about four and a half minutes after it was opened. A private copy,
    which a client opens while another client is still opening the same model,
    is not kept. Kotlin code compiled against an earlier release that calls the
    authenticator constructor without baseUrl must be compiled again, with no
    change to its source.
  • releaseMemory on an open client and the app's trim callbacks free at once
    each kept model that no client or session holds. The first client built with
    keepModels registers trim callbacks for the process that stay after every
    client closes, so a trim frees kept models while no client is open too.

Changed

  • Breaking change: MossClient.session throws the MossException of
    its load of the cloud index of the same name when that load fails, for
    example code NETWORK when the Moss cloud cannot be reached or
    DESERIALIZATION when the index's model artifact provenance does not
    match. It used to return an empty session, which a later pushIndex could
    push over the cloud index. An index that does not exist yet, or a name the
    cloud cannot address, still opens an empty session, and
    SessionOptions(autoLoadOnInit = false) skips the load. A foundation model
    such as the default moss-litelm still checks the credentials when the
    session opens, over the network for a client with a project key, so only
    modelId = "custom" opens with no network. Requires a packed
    libmoss_jni.so built from the matching libmoss.
  • A client or session that reuses an embedding model another client of the
    project holds, or one that keepModels kept, now asks the issuer for its own
    grant first. That adds one round trip and still skips the decrypt and session
    start. A client the issuer refuses now fails to load the model instead of
    using one another client opened.

Fixed

  • A session keeps its saved snapshot to itself while it serves vectors from
    it, also after saveToDisk writes a new generation. loadFromDisk and
    saveToDisk of the same session name and cache path in a second session,
    in this app or another process, throw MossException with code INTERNAL
    and the message "The saved session snapshot is open in another session."
    until the first session's native teardown finishes. close() returns at
    once and queues that teardown, which also sends the session's final
    telemetry, for up to 2 seconds, so a load or save right after close()
    can still throw. A save used to replace the file that held the lock, so
    after one save a second session could load and save the same snapshot
    beside the first and overwrite its saves. The lock is the file
    session.lock in the session's directory. Loading from a directory the
    app cannot write works when the snapshot already has its session.lock,
    which every save writes, and fails otherwise. A snapshot that an earlier
    version saved has none. Add an empty session.lock file to its directory,
    or load a copy: while nothing saves to the snapshot, copy its directory
    under the same name into another directory, make the copy writable by the
    app, and pass that other directory as the cache path. A .mossvec that
    loadIndex maps from cachePath is locked through a .lock file beside
    it. A second client that loads the same index from the same cachePath
    while the first holds it does not throw: it keeps that index's vectors in
    memory instead of mapping the file. Earlier versions take neither lock
    file, so a process on one of them and a process on this version do not
    lock each other out. Keep every process on an earlier version stopped
    while a process on this version has the same cache path open. Requires a
    packed libmoss_jni.so built from the matching libmoss.

Add it to an app module with implementation(files(...)). It is a file AAR, not a Maven Central package.

License

The AAR is licensed under the PolyForm Shield License 1.0.0, not under this repository's BSD 2-Clause License. LICENSE.txt holds the terms. The AAR carries it at META-INF/LICENSE.txt, and at assets/moss/LICENSE.txt beside the licenses of the third-party code it links.

Required Notice: Copyright InferEdge Inc. (https://inferedge.dev)