Skip to content

v0.2.0 — vision, media, compaction, budgets

Choose a tag to compare

@github-actions github-actions released this 23 Nov 15:45
· 15 commits to main since this release

v0.2.0 — vision, media, compaction, budgets

The first feature release since the public snapshot. Everything here is additive: no event kind,
wire shape or replay rule breaks, and a config that does not opt in keeps its request bytes
byte-identical.

Context and cost

  • Long sessions compact themselves. kian-orchestrator::compaction folds old turns under
    measured pressure — only when the worst-case next request would consume 90% of a declared
    model_profiles.*.context_window, or when the provider reports an overflow. The fold is an
    ordinary persisted maintenance turn (step/request with purpose: compact, then a compact
    event on success), uses the session's bound slot with one request and no fallback, and is capped
    at two folds per drain episode. Ordinary turns reserve 10% of the token allowance for it.
  • A session-lifetime token budget that refuses before the call. agents.<name>.budgets.tokens
    projects base + Σbudget/raised − Σturn/end.usage, admits the request plan's worst case and
    refuses the turn before step/request is persisted; the session parks awaiting_budget and
    resumes. kian raise-budget / raise_budget admits one durable, idempotent control row.
  • A price book turns usage into money. pricing: declares per-million-token cache-hit,
    cache-miss and output prices, peak windows and holidays, normalized once to integer micro-USD;
    kian cost attributes each turn/end usage to the last request target and reports priced /
    unpriced / unknown usage and the peak split. Nothing is written to the event stream.
  • Request plans. Every provider attempt is built by a pure planner returning the body, its
    dialect, profile digest, body digest and a token band; sender, persistence, cache check and the
    budget gate consume that one value. model_profiles: now also carries vision: true.
  • kian usage-stats, /metrics and session inspect report cache-miss input tokens and a hit
    rate. A rejected DeepSeek request (HTTP 422 / in-band 400/422) is classified InvalidResponse
    and no longer retried on a fallback.

Media and artifacts

  • Tool results ride the event stream by reference. With artifacts: configured, a successful
    tool/result above inline_max_bytes (16 KiB) is rewritten to a content-addressed
    {artifact, preview, truncated} before the event is appended; the store is sha256-addressed,
    atomic, path-traversal-proof and collected by retention (kian artifacts gc, 10 GiB / 30 days).
    artifact_read serves the payload back in bounded windows.
  • Media tools and file ingest. media: mounts image_ocr, audio_transcribe and
    speech_synthesize as audited tools over DeepSeek's media APIs; kian artifacts put <path>
    turns a local file into an artifact.
  • Vision inputs. A vision-profile target sees artifact-backed images as OpenAI image_url
    content parts; V1 and every image-free V2 body stay byte-identical, and a reclaimed blob degrades
    the picture rather than the turn.
  • Channel-edge media. Voice notes and photos from an adapter carrying the media envelope are
    written to the artifact store, transcribed, and admitted as text plus an artifact reference — no
    base64 ever re-enters the payload. Shipped adapters emit the envelope in their phase-2 contract.

Tools and operations

  • web_search and web_fetch on the operator's own DeepSeek key (web:), as ordinary
    audited tool calls; large pages spill by reference instead of being truncated.
  • Artifact retention runs inside kian serve beside the snapshot and view tickers, and
    kian session export --with-artifacts pins every referenced blob into a sibling directory so an
    audit package stays payload-complete.
  • Off-peak deferral. JSON-RPC submit/queue with defer: "off_peak" and a cron resident
    schedule with defer: off_peak persist the ordinary inbox row with a computed eligible_at,
    bounded by defer.max_wait_ms. No second scheduler, no timer per row, no new event kind.

Install

Prebuilt archives (with .sha256) for x86_64/aarch64 Linux and macOS are attached below, and
ghcr.io/flyer103/kian:0.2.0 carries the same kian + kiand pair. From source:

cargo build --release --locked -p kian-cli -p kiand

crates.io still carries 0.1.1; the registry publish is a separate step.

Boundaries, stated up front

  • No shipped channel adapter emits the media envelope yet — WeChat and iMessage record it as
    their phase-2 contract.
  • Search/Fetch per-request fees are not yet in the token cost projection.
  • Wall-clock budget raises are projected but not enforced while a drain is idle.
  • Compaction never runs for cost: only measured context pressure or a provider overflow triggers it.

Licensed under Apache-2.0.