Skip to content

Decision models: one setup in core and Settings for Jev, OpenJev, Sage and self-hosted, assignable per feature #8094

Open

Description

@senamakel

Summary

Add one place in the core and the UI where a user sets up decision models: Jev, OpenJev, Levanto Sage, a self-hosted Jev-compatible endpoint, and any later provider. Each feature that asks a decision model a question then picks from those profiles. Today three features each wire a decision model their own way, with separate config and separate credential rules, and only one of them has any UI.

Where decision models are used today

Consumer Config Providers reachable Client UI
TinyComputer step decisions [computer] decision_model (jev / open_jev / sage), sage_fast (config/schema/computer.rs); module config built in modules/computer_config.rs::jev Jev via TinyHumans or the OpenRouter key, OpenJev (openjev key / OPENJEV_API_KEY), Sage (sage key / SAGE_API_KEY) the module's own tinyinference-decisions Settings → Computer → Models (ComputerPanel.tsx::ComputerModelsSection), which stores the key with setCloudProviderKey
tool_search ranker [agent.tool_search] ranker, jev_route (auto / tinyhumans / typesafe / openrouter), jev_base_url; OPENHUMAN_JEV_ROUTE, OPENHUMAN_JEV_BASE_URL (config/schema/agent.rs) Jev via TinyHumans, TypeSafe (TYPESAFE_API_KEY, env only), OpenRouter tinyjevclient (crates/openhuman-tinyhumans/src/jev/{route,ranker}.rs) none
TinyMemes evaluate callback none, hard-wired managed Jev via the TinyHumans session only (tinymemes/jev.rs::managed) tinyinference-decisions none

What this costs:

  • A user who enters an OpenJev or Sage key for Computer can't use it for tool search or TinyMemes.
  • TypeSafe can only be set through an environment variable, and a self-hosted OpenJev only through the tinyinference-decisions API (Provider::SelfHosted, ClientConfig::self_hosted). Neither is in config or the UI.
  • The same provider has three spellings (open_jev, openjev, OpenJev), and the credential is resolved by three different code paths.
  • The tool-search route lives in the tinyhumans crate, while the Computer route lives in core, which also resolves the hosted bearer (resolve_backend_credential) itself.

Proposal

Core: a decisions config section and domain

[decisions]
default = "jev"

[[decisions.profiles]]
id = "jev"              # stable, user-chosen
provider = "jev"        # jev | open_jev | sage | typesafe | self_hosted
route = "auto"          # jev only: auto | tinyhumans | openrouter | typesafe
# endpoint = "http://127.0.0.1:8080/v1/systemone"  # self_hosted (and base-url overrides)
# model = "..."         # self_hosted: required model id the endpoint must echo
# credential = "sage"   # provider-key slug in the existing key store; never the secret itself
# options = { fast = true, reasoning = "...", latency = "..." }  # provider-specific (Sage modes)

[decisions.assign]
computer = "jev"        # TinyComputer step decisions
tool_search = "jev"     # tool_search ranker (ranker = "bm25" still turns it off)
tinymemes = "jev"
  • Use the tinyinference-decisions Provider set as the vocabulary. Do not redeclare it. If something is missing there (TypeSafe/OpenRouter routes for the hosted path, Sage option types), add it upstream in tinyinference first.
  • A new decisions/ domain in core (types.rs, ops.rs, schemas.rs) resolves a profile into a client config. Credentials come from the existing provider-key store (lookup_key_for_slug), with the current env vars kept as fallbacks.
  • The hosted route stays out of core. The tinyhumans / auto route of a Jev profile resolves through a registry hook that openhuman-tinyhumans fills: a "decision route" registry keyed by route id, in the same style as inference::registry. This keeps check-core-hosted-free.mjs green and moves jev/route.rs behind it.
  • Consumers ask the domain instead of building their own client:
    • modules/computer_config.rs::jev builds the module's jev block from assign.computer.
    • The tool_search ranker resolves assign.tool_search. ranker keeps its meaning (jev / auto / bm25 / compare), and "jev" now means "the assigned decision profile".
    • tinymemes/jev.rs::managed resolves assign.tinymemes, and stops being managed-Jev-only.
  • RPC (registered through core/all.rs, namespace decisions): decisions.list, decisions.upsert, decisions.delete (refuses a profile that is still assigned), decisions.assign, decisions.status (per profile: provider, route actually used, credential present), and decisions.test (one minimal evaluate call: reports latency and the model echoed, never the payload).
  • Migration: a config migration turns [computer] decision_model/sage_fast and [agent.tool_search] jev_route/jev_base_url into profiles plus assignments. The old keys and OPENHUMAN_JEV_ROUTE / OPENHUMAN_JEV_BASE_URL are read for one release with a deprecation warning, then removed. config_update_computer_settings keeps working for the planner/rescue fields; its decision_model field writes assign.computer.
  • Logging: [decisions] debug lines on profile resolution (profile id, provider, route, consumer). Never the key.

UI: Settings → AI → Decision models

  • A list of profiles. Each shows a provider badge, the route in use (TinyHumans credits / own key / unavailable, reusing the billing_route vocabulary), and a Test button.
  • An add/edit dialog (ModalShell + NativeSelect + TextField, password input for keys). The fields follow the provider: Jev shows the route, OpenJev and Sage show the key, Sage shows fast/reasoning/latency, self-hosted shows endpoint, model and optional key.
  • An "Used by" section that picks a profile for Computer, Tool search and TinyMemes.
  • ComputerModelsSection drops its own model select and key input in favour of the "Used by → Computer" picker plus a link to this page. Planner and rescue models stay where they are, since they are LLMs and not decision models. ComputerStatusCard reads from decisions.status.
  • All strings go through useT() with real translations in every locale. Shared buttons get an analyticsId, and success is tracked with trackAnalyticsEvent (provider kind only, no ids or keys).

Out of scope

  • Planner, rescue and output models for TinyComputer, which are chat LLMs configured under inference.
  • Adding new decision providers to tinyinference-decisions. This issue configures what the crate already supports.
  • Per-agent decision-model overrides in AgentSpec. This could be a follow-up once profiles exist.

Acceptance

  • One key entered in Decision models is usable by Computer, tool search and TinyMemes, each switchable independently.
  • OpenJev, Sage, TypeSafe and a self-hosted endpoint can be configured without environment variables.
  • An existing config with [computer] decision_model = "sage" and jev_route = "openrouter" migrates to equivalent profiles and assignments, with no change in behaviour (migration test).
  • No hosted route literal or TinyHumans hostname lands in core (pnpm rust:layout green). The hosted route resolves through the tinyhumans registry hook.
  • decisions.test works against the mock backend (scripts/mock-api-core.mjs gains a System One route) in a tests/json_rpc_e2e.rs case.
  • Vitest coverage for the settings page and the Computer panel change. An E2E spec under app/test/e2e/specs/ adds a Sage profile and assigns it to Computer.
  • about_app catalog updated, and docs updated in docs/gitbooks/en/ (config reference + a Decision models page).

Pointers

  • crates/openhuman-core/src/config/schema/computer.rs, config/ops/computer.rs, modules/computer_config.rs
  • crates/openhuman-core/src/config/schema/agent.rs (ToolSearchConfig), config/schema/load/env_overlay.rs
  • crates/openhuman-tinyhumans/src/jev/{route,ranker}.rs
  • crates/openhuman-core/src/tinymemes/jev.rs
  • vendor/tinyagents/vendor/tinyinference/crates/tinyinference-decisions/src/client/types.rs (Provider, ClientConfig::{openrouter, tinyhumans_openrouter, self_hosted}), src/sage/
  • app/src/components/settings/panels/ComputerPanel.tsx, ComputerStatusCard.tsx, app/src/utils/tauriCommands/config.ts

Activity

  1. added
    feature
    react-ui
    rust-core
    config-workspace
    on Oct 18, 2026
  2. M3gA-Mind commented on Nov 16, 2026

    @M3gA-Mind
    Collaborator

    Re-checked on current main by reading the code: still separate. TinyComputer has its own decision_model / sage_fast settings, and tool search has its own ranker / jev_route. There's no shared decision-model section yet. One update to the table: TinyMemes has been removed (#8371), so there are two consumers to unify, not three. Keeping this open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

config-workspacefeaturereact-uirust-core

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions