# wisent-ai/ster architecture

> Architecture diagram of the GitHub repository wisent-ai/ster, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wisent-ai/ster
- Repository: https://github.com/wisent-ai/ster

## Overview

Ster is a Rust toolkit and CLI for reading, steering, evaluating, and training open-weight language models. Users provide contrastive examples or typed decision requests; Ster loads a checkpoint, processes inputs through its native model runtime, and returns vectors, scores, decisions, generations, or trained adapter artifacts. Its major branches include pair authoring, representation steering, typed decisions, and LoRA tuning. The README and source index establish these capabilities and several module relationships; unsampled implementation details are represented only where documented.

Main entry points: [`src/cli/command.rs`](https://github.com/wisent-ai/ster/blob/main/src/cli/command.rs) (CLI commands), [`src/model/decoder.rs`](https://github.com/wisent-ai/ster/blob/main/src/model/decoder.rs) (Transformer decoder), [`src/runtime/mod.rs`](https://github.com/wisent-ai/ster/blob/main/src/runtime/mod.rs) (Checkpoint runtime), [`src/workflow/mod.rs`](https://github.com/wisent-ai/ster/blob/main/src/workflow/mod.rs) (Steering workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_cli["CLI commands<br/>[command.rs]"]
  node_converse["Conversation CLI<br/>[converse.rs]"]
  node_request["JSON request API<br/>[mod.rs]"]
  node_workspace["Workspace management<br/>[manage.rs]"]
end

subgraph group_steering["Representation steering"]
  node_pairs["Pair authoring<br/>[mod.rs]"]
  node_workflow["Steering workflows<br/>[mod.rs]"]
  node_train_direction["Direction training<br/>[train.rs]"]
  node_evaluation["Direction evaluation<br/>[evaluate.rs]"]
  node_representation["Representation extraction<br/>[representation.rs]"]
  node_steering_artifact["Steering artifact<br/>[artifact.rs]"]
end

subgraph group_decision["Typed decisions"]
  node_decision_core["Decision inference<br/>[mod.rs]"]
  node_decision_request["Decision request<br/>[request.rs]"]
end

subgraph group_tuning["Adapter training"]
  node_tuning["Tuning objectives<br/>[mod.rs]"]
  node_lora["LoRA adapters<br/>[adapter.rs]"]
  node_lora_artifact["Adapter artifacts<br/>[artifact.rs]"]
end

subgraph group_engine["Model engine"]
  node_runtime["Checkpoint runtime<br/>[mod.rs]"]
  node_loader["Checkpoint loading<br/>[mod.rs]"]
  node_tokenizer["Text and vocabulary<br/>[vocabulary.rs]"]
  node_decoder["Transformer decoder<br/>[decoder.rs]"]
  node_attention["Attention layers<br/>[mod.rs]"]
  node_cache["Decode cache<br/>[cache.rs]"]
  node_experts["Expert layers<br/>[experts.rs]"]
  node_deepseek_attention["DeepSeek attention<br/>[attention.rs]"]
  node_deepseek_compressor["Attention compressor<br/>[compressor.rs]"]
  node_chat_template["Chat templates<br/>[template.rs]"]
end

node_operator(("Operator"))

node_operator -->|"runs commands"| node_cli
node_operator -->|"sends JSON"| node_request
node_cli -->|"dispatches to"| node_converse
node_cli -.->|"runs workflows"| node_workflow
node_cli -->|"runs pair tools"| node_pairs
node_cli -->|"manages workspace"| node_workspace
node_request -->|"dispatches jobs"| node_workflow
node_pairs -.->|"authors pair data"| node_steering_artifact
node_workflow -->|"exposes training"| node_train_direction
node_workflow -->|"exposes evaluation"| node_evaluation
node_train_direction -.->|"produces vectors"| node_steering_artifact
node_evaluation -.->|"scores vectors"| node_steering_artifact
node_workflow -.->|"extracts states"| node_representation
node_cli -->|"runs decisions"| node_decision_core
node_decision_core -->|"reads request"| node_decision_request
node_cli -->|"runs tuning"| node_tuning
node_tuning -->|"trains adapters"| node_lora
node_tuning -->|"evaluates and exports"| node_lora_artifact
node_runtime -->|"loads checkpoint"| node_loader
node_runtime -->|"encodes text"| node_tokenizer
node_runtime -->|"runs inference"| node_decoder
node_decoder -->|"uses attention"| node_attention
node_decoder -->|"uses decode cache"| node_cache
node_decoder -->|"uses expert layers"| node_experts
node_decoder -->|"uses family attention"| node_deepseek_attention
node_decoder -->|"uses compression"| node_deepseek_compressor
node_runtime -->|"applies chat format"| node_chat_template
node_converse -.->|"generates responses"| node_runtime

click node_cli "https://github.com/wisent-ai/ster/blob/main/src/cli/command.rs"
click node_converse "https://github.com/wisent-ai/ster/blob/main/src/cli/converse.rs"
click node_request "https://github.com/wisent-ai/ster/blob/main/src/request/mod.rs"
click node_pairs "https://github.com/wisent-ai/ster/blob/main/src/pairs/mod.rs"
click node_workflow "https://github.com/wisent-ai/ster/blob/main/src/workflow/mod.rs"
click node_train_direction "https://github.com/wisent-ai/ster/blob/main/src/workflow/train.rs"
click node_evaluation "https://github.com/wisent-ai/ster/blob/main/src/workflow/evaluate.rs"
click node_representation "https://github.com/wisent-ai/ster/blob/main/src/representation.rs"
click node_steering_artifact "https://github.com/wisent-ai/ster/blob/main/src/artifact.rs"
click node_decision_core "https://github.com/wisent-ai/ster/blob/main/src/decide/mod.rs"
click node_decision_request "https://github.com/wisent-ai/ster/blob/main/src/decide/request.rs"
click node_tuning "https://github.com/wisent-ai/ster/blob/main/src/tune/mod.rs"
click node_lora "https://github.com/wisent-ai/ster/blob/main/src/lora/adapter.rs"
click node_lora_artifact "https://github.com/wisent-ai/ster/blob/main/src/lora/artifact.rs"
click node_runtime "https://github.com/wisent-ai/ster/blob/main/src/runtime/mod.rs"
click node_loader "https://github.com/wisent-ai/ster/blob/main/src/runtime/load/mod.rs"
click node_tokenizer "https://github.com/wisent-ai/ster/blob/main/src/runtime/vocabulary.rs"
click node_decoder "https://github.com/wisent-ai/ster/blob/main/src/model/decoder.rs"
click node_attention "https://github.com/wisent-ai/ster/blob/main/src/model/attention/mod.rs"
click node_cache "https://github.com/wisent-ai/ster/blob/main/src/model/cache.rs"
click node_experts "https://github.com/wisent-ai/ster/blob/main/src/model/layer/experts.rs"
click node_deepseek_attention "https://github.com/wisent-ai/ster/blob/main/src/model/deepseek4/attention.rs"
click node_deepseek_compressor "https://github.com/wisent-ai/ster/blob/main/src/model/deepseek4/compressor.rs"
click node_chat_template "https://github.com/wisent-ai/ster/blob/main/src/chat/template.rs"
click node_workspace "https://github.com/wisent-ai/ster/blob/main/src/workspace/manage.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_converse,node_request,node_workspace toneBlue
class node_pairs,node_workflow,node_train_direction,node_evaluation,node_representation,node_steering_artifact toneAmber
class node_decision_core,node_decision_request toneMint
class node_tuning,node_lora,node_lora_artifact toneRose
class node_runtime,node_loader,node_tokenizer,node_decoder,node_attention,node_cache,node_experts,node_deepseek_attention,node_deepseek_compressor,node_chat_template,node_operator toneIndigo
```

## Components

### User interfaces

- [CLI commands](https://github.com/wisent-ai/ster/blob/main/src/cli/command.rs): `src/cli/command.rs`
- [Conversation CLI](https://github.com/wisent-ai/ster/blob/main/src/cli/converse.rs): `src/cli/converse.rs`
- [JSON request API](https://github.com/wisent-ai/ster/blob/main/src/request/mod.rs): `src/request/mod.rs`
- [Workspace management](https://github.com/wisent-ai/ster/blob/main/src/workspace/manage.rs): `src/workspace/manage.rs`

### Representation steering

- [Pair authoring](https://github.com/wisent-ai/ster/blob/main/src/pairs/mod.rs): `src/pairs/mod.rs`
- [Steering workflows](https://github.com/wisent-ai/ster/blob/main/src/workflow/mod.rs): `src/workflow/mod.rs`
- [Direction training](https://github.com/wisent-ai/ster/blob/main/src/workflow/train.rs): `src/workflow/train.rs`
- [Direction evaluation](https://github.com/wisent-ai/ster/blob/main/src/workflow/evaluate.rs): `src/workflow/evaluate.rs`
- [Representation extraction](https://github.com/wisent-ai/ster/blob/main/src/representation.rs): `src/representation.rs`
- [Steering artifact](https://github.com/wisent-ai/ster/blob/main/src/artifact.rs): `src/artifact.rs`

### Typed decisions

- [Decision inference](https://github.com/wisent-ai/ster/blob/main/src/decide/mod.rs): `src/decide/mod.rs`
- [Decision request](https://github.com/wisent-ai/ster/blob/main/src/decide/request.rs): `src/decide/request.rs`

### Adapter training

- [Tuning objectives](https://github.com/wisent-ai/ster/blob/main/src/tune/mod.rs): `src/tune/mod.rs`
- [LoRA adapters](https://github.com/wisent-ai/ster/blob/main/src/lora/adapter.rs): `src/lora/adapter.rs`
- [Adapter artifacts](https://github.com/wisent-ai/ster/blob/main/src/lora/artifact.rs): `src/lora/artifact.rs`

### Model engine

- [Checkpoint runtime](https://github.com/wisent-ai/ster/blob/main/src/runtime/mod.rs): `src/runtime/mod.rs`
- [Checkpoint loading](https://github.com/wisent-ai/ster/blob/main/src/runtime/load/mod.rs): `src/runtime/load/mod.rs`
- [Text and vocabulary](https://github.com/wisent-ai/ster/blob/main/src/runtime/vocabulary.rs): `src/runtime/vocabulary.rs`
- [Transformer decoder](https://github.com/wisent-ai/ster/blob/main/src/model/decoder.rs): `src/model/decoder.rs`
- [Attention layers](https://github.com/wisent-ai/ster/blob/main/src/model/attention/mod.rs): `src/model/attention/mod.rs`
- [Decode cache](https://github.com/wisent-ai/ster/blob/main/src/model/cache.rs): `src/model/cache.rs`
- [Expert layers](https://github.com/wisent-ai/ster/blob/main/src/model/layer/experts.rs): `src/model/layer/experts.rs`
- [DeepSeek attention](https://github.com/wisent-ai/ster/blob/main/src/model/deepseek4/attention.rs): `src/model/deepseek4/attention.rs`
- [Attention compressor](https://github.com/wisent-ai/ster/blob/main/src/model/deepseek4/compressor.rs): `src/model/deepseek4/compressor.rs`
- [Chat templates](https://github.com/wisent-ai/ster/blob/main/src/chat/template.rs): `src/chat/template.rs`

### Other components

- **Operator**

## Connections

- Operator → CLI commands: runs commands
- Operator → JSON request API: sends JSON (evidence: `src/request/mod.rs`)
- CLI commands → Conversation CLI: dispatches to (evidence: `src/cli/command.rs`)
- CLI commands → Steering workflows: runs workflows
- CLI commands → Pair authoring: runs pair tools (evidence: `src/pairs/mod.rs`)
- CLI commands → Workspace management: manages workspace (evidence: `src/cli/command.rs`)
- JSON request API → Steering workflows: dispatches jobs (evidence: `src/request/mod.rs`)
- Pair authoring → Steering artifact: authors pair data
- Steering workflows → Direction training: exposes training (evidence: `src/workflow/mod.rs`)
- Steering workflows → Direction evaluation: exposes evaluation (evidence: `src/workflow/mod.rs`)
- Direction training → Steering artifact: produces vectors
- Direction evaluation → Steering artifact: scores vectors
- Steering workflows → Representation extraction: extracts states
- CLI commands → Decision inference: runs decisions (evidence: `src/cli/command.rs`)
- Decision inference → Decision request: reads request (evidence: `src/decide/mod.rs`)
- CLI commands → Tuning objectives: runs tuning (evidence: `src/cli/command.rs`)
- Tuning objectives → LoRA adapters: trains adapters (evidence: `src/tune/mod.rs`)
- Tuning objectives → Adapter artifacts: evaluates and exports (evidence: `src/tune/mod.rs`)
- Checkpoint runtime → Checkpoint loading: loads checkpoint (evidence: `src/runtime/mod.rs`)
- Checkpoint runtime → Text and vocabulary: encodes text (evidence: `src/runtime/mod.rs`)
- Checkpoint runtime → Transformer decoder: runs inference (evidence: `src/runtime/mod.rs`)
- Transformer decoder → Attention layers: uses attention (evidence: `src/model/mod.rs`)
- Transformer decoder → Decode cache: uses decode cache (evidence: `src/model/mod.rs`)
- Transformer decoder → Expert layers: uses expert layers
- Transformer decoder → DeepSeek attention: uses family attention
- Transformer decoder → Attention compressor: uses compression
- Checkpoint runtime → Chat templates: applies chat format (evidence: `src/runtime/mod.rs`)
- Conversation CLI → Checkpoint runtime: generates responses
