Skip to content

Releases

v0.4.2

Choose a tag to compare

@github-actions github-actions released this 02 Dec 07:54
12205aa

Fixed

  • End a hold whose caller stopped waiting
  • Pass join_failed without a closure
  • Claim a run in this process before stepping it (#136)
  • Budget a routed call for its targets' extra calls
  • Tell a budget pause held by another call from a spent cap
  • Bound a capped admission by the ledger's admission timeout (#86)
  • Pin a stale read as held and say a held pause can clear
  • Name a cap spent alone when the store refused on a held cap
  • Roll back a hold whose caller left before the commit

Upgrade note

  • A capped admission whose ledger read does not finish at once now waits under the ledger's admission timeout (#86), so it needs a Tokio runtime with timers. SQLite reads always take this path. The runtimes troupekit builds have timers. If you build your own runtime, turn timers on (Builder::new_current_thread().enable_time() or enable_all()); without them such an admission panics.

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 02 Dec 01:46
6f90066

Fixed

  • Start a hold's expiry when its write runs
  • Keep reported usage for an error the provider declares
  • Bill the search allowance on failed metered and routed calls
  • Bill an accepted unary reply with no stop at the bound
  • Bill a declared unary error the usage its body reported
  • Stop retrying a route refused by the daily cloud cap
  • Bound the spend estimate's input at one token per byte
  • Bill an accepted reply that is cut off at its bound
  • Hold a call's worst case in the store so other processes see it
  • Hold a route's daily cloud cap at the input bound
  • Keep a call's hold and cost until the ledger records it

Troupekit 0.4.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 18:30
1ba7709

Troupekit is an open-source Rust framework for LLM agents that run inside your own program. 0.4.0 lets you call it from Swift, Kotlin and Python, and adds adapters for the on-device models on iOS and Android.

The kill_resume example: the worker is killed with SIGKILL inside the second of three tools, a second worker finishes the run, and the result is the same as an uninterrupted run

cargo add troupekit

Since 0.4.0, the spend fixes are in the 0.4.1 and 0.4.2 notes.

What is new

Python

  • A troupekit package over the Rust core, for Python 3.11 or newer.
  • Calls block with the GIL released. troupekit.aio has the async forms.
  • Your Python code can be the model, a tool or the HTTP transport. The agent calls back into it.

Swift, iOS 16 and macOS 13 or newer

  • Troupekit, the library over the Rust core.
  • TroupekitApple, with AppleFoundationModel for Apple's on-device Foundation Models, an Apple embedder and a URLSession transport.
  • The on-device model needs iOS 26 on a device that supports Apple Intelligence, with it turned on and the model downloaded. Its window is 4096 tokens, shared by instructions, documents and the answer.

Kotlin, Android API 26 or newer

  • troupekit, the module over the Rust core.
  • troupekit-android, with OnDeviceModel, which loads a LiteRT-LM model file your app supplies, a configurable timeout for an on-device reply, and an HttpURLConnection transport.

In every binding

  • start(input) saves the first checkpoint and returns the run id before any model call, so the app holds the id before anything can die.
  • Stream a run's events to your app as they happen.
  • Resume a run in bounded windows, so a phone's background time can carry it forward.
  • Build and run graphs, add knowledge with an embedder your app supplies, and use memory.
  • Load agents from persona TOML files.

Two demo apps

  • examples/ios, a SwiftUI support agent, and examples/android, the same agent on platform Android views. Its runtime dependencies are troupekit-android and kotlinx-coroutines.
  • Both answer from bundled support articles and stream the answer.
  • Force-quit either app mid-answer and open it again: it resumes the same run from the last checkpoint and shows the answer once.
  • Both resume an unfinished run in a background window of up to 25 seconds, when the OS opens one.
  • A cloud API key is stored in the Keychain on iOS and encrypted with a key held in the Android Keystore on Android. It is never part of the app bundle.

Spend and privacy

  • Each routed call is billed at the target that served it, and a failed call that reported usage is billed too.
  • An in-flight remote call's estimated cost is held against the daily cap until its real cost is recorded. Spend is reread across midnight, and the cap is checked again before a remote fallback.
  • A private agent refuses to build without an on-device model, and refuses the built-in network tools: web_fetch, web_search, declarative HTTP tools and hosted tools.
  • The agent's model API key is redacted from HTTP status error text and scrubbed from traces. The bindings also redact credential headers in every text form.

Install

  • Rust: cargo add troupekit. All 17 crates are on crates.io at 0.4.0.
  • Python, Swift and Kotlin build from a clone. PyPI, Swift Package Manager and Maven packages are not published yet.
  • Python: cargo xtask build-wheel, then python -m pip install dist/troupekit-*-abi3-*.whl.
  • Swift: cargo xtask build-xcframework. The Swift package at the repository root uses it.
  • Kotlin: cargo xtask build-aar.

Limits, stated up front

  • A crash repeats the step that was running, every tool call and parallel branch in it included. Each tool call carries an idempotency key that stays the same on the replay, and a tool with side effects has to check it to skip the repeat.
  • In 0.4.0 the spend estimate counted input as about four bytes per token, so a token-dense input could cost more than estimated (#80). 0.4.1 bounds the estimate's input at one token per byte.
  • In 0.4.0 a shared period cap held within one process, and runs in separate processes could spend past it together (#79). From 0.4.1 a call's worst case is held in the store, so other processes see it. In SQLite a hold lasts hold_ms, one hour by default. A call that runs longer than its hold gives its room back to other processes, so the cap can be passed (#204).
  • Anthropic cache writes are counted at the plain input price, so the spend ledger under-counts them and a cap can be passed (#202, open as of 0.4.2).
  • A route's daily cloud cap is counted inside one process, so runs in separate processes can pass it together (#183, open).
  • Traces scrub the agent's model API key only. A key a tool reads, or one held only by a custom model client, is not scrubbed.
  • Laws on an agent are checked and stored. Proving them is planned for 0.7, and team, crew and handoff patterns for 0.5.
  • Android ships no on-device text embedder. The Android demo finds its articles with a word-hash embedder, which matches on shared words only.
  • The API can still change before 1.0.

Repo: https://github.com/ChaoticQubit/troupekit
Docs: https://troupekit.org/
Changelog: https://github.com/ChaoticQubit/troupekit/blob/main/CHANGELOG.md

v0.3.2

Choose a tag to compare

@github-actions github-actions released this 29 Nov 10:44
30ebf96

Fixed

  • Clear the warnings the warnings-as-errors gate exposed
  • Clear the clippy lints from the second warnings-as-errors run
  • Keep FnTool::new returning Arc under an expect
  • Name the public API break in the FnTool::new expect reason
  • Clear the clippy lints from the fourth warnings-as-errors run

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 29 Nov 02:46
d60a81a

Fixed

  • Skip the native llama build on docs.rs
  • Publish context without its dev store and pin the tag commit
  • Ship the built-in catalog inside the crates that read it

Added

  • Every crate is published on crates.io with a homepage and docs.rs settings.
  • Prebuilt troupekit command-line archives for Linux (x86_64, arm64), macOS (arm64) and Windows (x86_64), with SHA-256 checksums, build attestations and a CycloneDX SBOM on each GitHub Release; cargo binstall troupekit-cli installs them.
  • Contributing guide, code of conduct, security policy, issue and pull request templates.

Fixed

  • The built-in provider and search catalogs ship inside the crates that read them, so the published crates build on their own.
  • docs.rs builds troupekit-local with the llama feature without compiling llama.cpp.