# strands-labs/strands-decider architecture

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

- Interactive diagram: https://gitdiagram.com/strands-labs/strands-decider
- Repository: https://github.com/strands-labs/strands-decider

## Overview

Strands Decider is a compact decision model for answering typed questions about supplied state, returning option probabilities and calibrated confidence rather than generated text. The main workflow is request validation, prompt rendering, model scoring, and typed answer readout, exposed through a CLI or HTTP server. A second major branch prepares and trains the model; synthetic-data generation and evaluation support that lifecycle. Source-index references and README statements support the shown links; unsampled subsystem internals are represented only where the tree or README establishes the capability.

Main entry points: [`src/strands_decider/infer.py`](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/infer.py) (Inference engine), [`src/strands_decider/cli.py`](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/cli.py) (CLI), [`src/strands_decider/train.py`](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/train.py) (Model training), [`src/strands_decider/schema.py`](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/schema.py) (Request schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[cli.py]"]
  node_http["HTTP API<br/>[server.py]"]
end

subgraph group_runtime["Inference runtime"]
  node_schema["Request schema<br/>[schema.py]"]
  node_prompt["Prompt renderer<br/>[prompting.py]"]
  node_engine["Inference engine<br/>[infer.py]"]
  node_model["Decision model<br/>[modeling.py]"]
  node_mps["MPS kernels<br/>[mps_kernels.py]"]
end

subgraph group_learning["Data and training"]
  node_recipes["Data recipes<br/>[recipes.py]"]
  node_examples["Example format<br/>[format.py]"]
  node_multistep["Multistep data<br/>[multistep.py]"]
  node_synthetic["Synthetic data<br/>[synth.py]"]
  node_paired["Synthetic pairs<br/>[synth_pairs.py]"]
  node_generated["Document generation"]
  node_llmclient["LLM client<br/>[llm_client.py]"]
  node_collate["Batch collator<br/>[collate.py]"]
  node_sampling["Data sampling<br/>[sampling.py]"]
  node_distributed["Distributed training<br/>[distributed.py]"]
  node_training["Model training<br/>[train.py]"]
end

subgraph group_quality["Evaluation and export"]
  node_evaluation["Evaluation<br/>[evaluate.py]"]
  node_hfexport["HF export<br/>[hf_export.py]"]
  node_evaluator["Benchmark tools<br/>[bench_local.py]"]
end

node_user(("Model user"))
node_llmprovider{{"LLM provider"}}

node_user -->|"asks via"| node_cli
node_user -->|"sends request"| node_http
node_cli -->|"loads and evaluates"| node_engine
node_cli -->|"builds questions"| node_schema
node_cli -->|"builds data"| node_recipes
node_cli -->|"starts training"| node_training
node_cli -->|"runs evaluation"| node_evaluation
node_cli -->|"starts server"| node_http
node_http -->|"validates request"| node_schema
node_http -->|"evaluates request"| node_engine
node_engine -->|"reads typed request"| node_schema
node_engine -->|"renders questions"| node_prompt
node_engine -->|"scores options"| node_model
node_engine -->|"installs on MPS"| node_mps
node_engine -->|"returns typed answers"| node_schema
node_recipes -->|"uses example format"| node_examples
node_multistep -->|"uses example format"| node_examples
node_generated -->|"calls client"| node_llmclient
node_llmclient -.->|"sends completions"| node_llmprovider
node_collate -->|"batches examples"| node_examples
node_collate -->|"renders training prompts"| node_prompt
node_sampling -->|"samples examples"| node_examples
node_training -->|"batches training data"| node_collate
node_training -->|"uses sampler"| node_sampling
node_training -->|"coordinates workers"| node_distributed
node_training -->|"optimizes model"| node_model
node_evaluation -->|"batches evaluation data"| node_collate
node_evaluation -->|"scores predictions"| node_model
node_evaluator -->|"runs local inference"| node_engine
node_evaluator -->|"uses question types"| node_schema
node_hfexport -->|"exports model"| node_model

click node_cli "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/cli.py"
click node_http "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/server.py"
click node_schema "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/schema.py"
click node_prompt "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/prompting.py"
click node_engine "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/infer.py"
click node_model "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/modeling.py"
click node_mps "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/mps_kernels.py"
click node_recipes "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/recipes.py"
click node_examples "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/format.py"
click node_multistep "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/multistep.py"
click node_synthetic "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/synth.py"
click node_paired "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/synth_pairs.py"
click node_generated "https://github.com/strands-labs/strands-decider/blob/main/data/generators/gen_documents_openrouter.py"
click node_llmclient "https://github.com/strands-labs/strands-decider/blob/main/data/generators/llm_client.py"
click node_collate "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/collate.py"
click node_sampling "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/sampling.py"
click node_distributed "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/distributed.py"
click node_training "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/train.py"
click node_evaluation "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/evaluate.py"
click node_hfexport "https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/hf_export.py"
click node_evaluator "https://github.com/strands-labs/strands-decider/blob/main/evaluation/bench_local.py"

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_http,node_user toneBlue
class node_schema,node_prompt,node_engine,node_model,node_mps toneAmber
class node_recipes,node_examples,node_multistep,node_synthetic,node_paired,node_generated,node_llmclient,node_collate,node_sampling,node_distributed,node_training toneMint
class node_evaluation,node_hfexport,node_evaluator toneRose
class node_llmprovider toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/cli.py): `src/strands_decider/cli.py`
- [HTTP API](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/server.py): `src/strands_decider/server.py`

### Inference runtime

- [Request schema](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/schema.py): `src/strands_decider/schema.py`
- [Prompt renderer](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/prompting.py): `src/strands_decider/prompting.py`
- [Inference engine](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/infer.py): `src/strands_decider/infer.py`
- [Decision model](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/modeling.py): `src/strands_decider/modeling.py`
- [MPS kernels](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/mps_kernels.py): `src/strands_decider/mps_kernels.py`

### Data and training

- [Data recipes](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/recipes.py): `src/strands_decider/data/recipes.py`
- [Example format](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/format.py): `src/strands_decider/data/format.py`
- [Multistep data](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/multistep.py): `src/strands_decider/data/multistep.py`
- [Synthetic data](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/synth.py): `src/strands_decider/data/synth.py`
- [Synthetic pairs](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/synth_pairs.py): `src/strands_decider/data/synth_pairs.py`
- [Document generation](https://github.com/strands-labs/strands-decider/blob/main/data/generators/gen_documents_openrouter.py): `data/generators/gen_documents_openrouter.py`
- [LLM client](https://github.com/strands-labs/strands-decider/blob/main/data/generators/llm_client.py): `data/generators/llm_client.py`
- [Batch collator](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/collate.py): `src/strands_decider/data/collate.py`
- [Data sampling](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/data/sampling.py): `src/strands_decider/data/sampling.py`
- [Distributed training](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/distributed.py): `src/strands_decider/distributed.py`
- [Model training](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/train.py): `src/strands_decider/train.py`

### Evaluation and export

- [Evaluation](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/evaluate.py): `src/strands_decider/evaluate.py`
- [HF export](https://github.com/strands-labs/strands-decider/blob/main/src/strands_decider/hf_export.py): `src/strands_decider/hf_export.py`
- [Benchmark tools](https://github.com/strands-labs/strands-decider/blob/main/evaluation/bench_local.py): `evaluation/bench_local.py`

### Other components

- **Model user**
- **LLM provider**

## Connections

- Model user → CLI: asks via (evidence: `README.md`)
- Model user → HTTP API: sends request (evidence: `README.md`)
- CLI → Inference engine: loads and evaluates (evidence: `src/strands_decider/cli.py`)
- CLI → Request schema: builds questions (evidence: `src/strands_decider/cli.py`)
- CLI → Data recipes: builds data (evidence: `src/strands_decider/cli.py`)
- CLI → Model training: starts training (evidence: `src/strands_decider/cli.py`)
- CLI → Evaluation: runs evaluation (evidence: `src/strands_decider/cli.py`)
- CLI → HTTP API: starts server (evidence: `src/strands_decider/cli.py`)
- HTTP API → Request schema: validates request (evidence: `src/strands_decider/server.py`)
- HTTP API → Inference engine: evaluates request (evidence: `src/strands_decider/server.py`)
- Inference engine → Request schema: reads typed request (evidence: `src/strands_decider/infer.py`)
- Inference engine → Prompt renderer: renders questions (evidence: `src/strands_decider/infer.py`)
- Inference engine → Decision model: scores options (evidence: `src/strands_decider/infer.py`)
- Inference engine → MPS kernels: installs on MPS (evidence: `src/strands_decider/infer.py`)
- Inference engine → Request schema: returns typed answers (evidence: `src/strands_decider/infer.py`)
- Data recipes → Example format: uses example format (evidence: `src/strands_decider/data/recipes.py`)
- Multistep data → Example format: uses example format (evidence: `src/strands_decider/data/multistep.py`)
- Document generation → LLM client: calls client (evidence: `data/generators/gen_documents_openrouter.py`)
- LLM client → LLM provider: sends completions
- Batch collator → Example format: batches examples (evidence: `src/strands_decider/data/collate.py`)
- Batch collator → Prompt renderer: renders training prompts (evidence: `src/strands_decider/data/collate.py`)
- Data sampling → Example format: samples examples (evidence: `src/strands_decider/data/sampling.py`)
- Model training → Batch collator: batches training data (evidence: `src/strands_decider/train.py`)
- Model training → Data sampling: uses sampler (evidence: `src/strands_decider/train.py`)
- Model training → Distributed training: coordinates workers (evidence: `src/strands_decider/train.py`)
- Model training → Decision model: optimizes model (evidence: `src/strands_decider/train.py`)
- Evaluation → Batch collator: batches evaluation data (evidence: `src/strands_decider/evaluate.py`)
- Evaluation → Decision model: scores predictions (evidence: `src/strands_decider/evaluate.py`)
- Benchmark tools → Inference engine: runs local inference (evidence: `evaluation/bench_local.py`)
- Benchmark tools → Request schema: uses question types (evidence: `evaluation/bench_local.py`)
- HF export → Decision model: exports model (evidence: `src/strands_decider/hf_export.py`)
