Skip to content

ai-foundation

Enterprise Part of the commercial Kumiko Enterprise offering — not in the open framework.

Plugin host and connection store that wires an LLM (and optionally a transcription and a speech) provider to your app without coupling it to a specific vendor SDK. A tenant keeps its AI connections here (anthropic, openai, openai-compatible; the API key is a write-only, encrypted field) and assigns them to jobs in the standard models (text, images, dictation, read-aloud). Add it when you want features like ai-patch, ai-generate, ai-triage, or ai-draft — each of those calls createLLMProviderForTenant(ctx, tenantId) from this package to resolve the provider at request time; transcription uses createTranscribeProviderForTenant, read-aloud createSpeechProviderForTenant. A SystemAdmin can provide platform connections (one key per vendor) that every tenant may pick. Adapters (ai-provider-anthropic, ai-provider-openai-compat) only build the provider; credentials and endpoints are resolved here.

This Enterprise implementation is optional. If you need a narrower or domain-specific version, you can build an app-owned feature, handler, or job with Kumiko’s public extension points.

Use this package when you want the maintained implementation, its existing contracts, and the surrounding operational behavior. A custom implementation is not drop-in compatible automatically: your app owns its authorization, validation, integrations, tests, security review, and production operations.

Start with Features and composition and Custom write handlers.

What this feature needs to run (Requires, top) and the write commands this feature provides (Provides, bottom).

flowchart TB
  n_ai_foundation["ai-foundation"]
  subgraph how_reqs["Requires"]
    n_config["config"]
  end
  subgraph how_provides["Provides"]
    n_cmd_ai_foundation_write_ai_connection_create(["create"])
    n_cmd_ai_foundation_write_ai_connection_delete(["delete"])
    n_cmd_ai_foundation_write_ai_connection_update(["update"])
    n_cmd_ai_foundation_write_refresh_models(["refresh-models"])
  end
  n_config --> n_ai_foundation
  n_ai_foundation --> n_cmd_ai_foundation_write_ai_connection_create
  n_ai_foundation --> n_cmd_ai_foundation_write_ai_connection_delete
  n_ai_foundation --> n_cmd_ai_foundation_write_ai_connection_update
  n_ai_foundation --> n_cmd_ai_foundation_write_refresh_models

Provides — write commands this feature registers (dispatch them through the command bus):

  • ai-foundation:write:ai-connection:create
  • ai-foundation:write:ai-connection:delete
  • ai-foundation:write:ai-connection:update
  • ai-foundation:write:refresh-models
  • Requires: config
  • Activation: always on (not toggleable)

Per-tenant config keys, set via the tenant-admin UI or a seed. 🔒 = encrypted at rest.

KeyTypeDefaultScopeWho can writeWho can read
default-effortselect (low | medium | high | xhigh | max)hightenantsystem, TenantAdmin, SystemAdminall
default-max-tokensnumber (256–200000)16000tenantsystem, TenantAdmin, SystemAdminall
image-connectiontext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
image-modeltext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
migrated-legacy-connectionstext""tenantsystem, SystemAdminsystem, SystemAdmin
monthly-transcription-secondsnumber (≥ 1)—tenantsystem, TenantAdmin, SystemAdminall
platform-anthropic-api-keytext—system 🔒system, SystemAdminSystemAdmin
platform-anthropic-endpointtext""systemsystem, SystemAdminSystemAdmin
platform-openai-compat-api-keytext—system 🔒system, SystemAdminSystemAdmin
platform-openai-compat-endpointtext""systemsystem, SystemAdminSystemAdmin
platform-openrouter-api-keytext—system 🔒system, SystemAdminSystemAdmin
platform-openrouter-endpointtext""systemsystem, SystemAdminSystemAdmin
speech-connectiontext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
speech-modeltext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
speech-voicetext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
text-connectiontext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
text-modeltext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
transcription-connectiontext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User
transcription-modeltext""tenantsystem, TenantAdmin, SystemAdminTenantAdmin, SystemAdmin, User