# mohit67890/imajev architecture

> Architecture diagram of the GitHub repository mohit67890/imajev, 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/mohit67890/imajev
- Repository: https://github.com/mohit67890/imajev

## Overview

Imajev is a local typed-decision model: a caller supplies questions, application state and optional images, and receives calibrated probabilities plus an explicit abstention option. Its playground serves this workflow through an HTTP API; model backends compile and score the questions, while shared contracts and calibration shape the response. ImajevBench provides a separate submission-evaluation and review workflow. The graph also preserves the documented live examples and benchmark capabilities. Connections beyond the sampled excerpts are included only where the README or SOURCE INDEX supports them.

Main entry points: [`scripts/playground/server.py`](https://github.com/mohit67890/imajev/blob/main/scripts/playground/server.py) (HTTP playground), [`src/imajev_bench/cli.py`](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/cli.py) (Benchmark CLI), [`src/vision_decision/contracts.py`](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/contracts.py) (Request contracts), [`src/imajev_bench/harness.py`](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/harness.py) (Evaluation harness)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serving["Decision serving"]
  node_playground["HTTP playground<br/>[server.py]"]
  node_request_contract["Request contracts<br/>[contracts.py]"]
  node_jev_api["Jev request mapping<br/>[jev_api.py]"]
  node_image_input["Image handling<br/>[images.py]"]
end

subgraph group_bench["ImajevBench"]
  node_bench_cli["Benchmark CLI<br/>[cli.py]"]
  node_bench_schema["Dataset schema<br/>[schema.py]"]
  node_bench_runner["Submission runner<br/>[runner.py]"]
  node_bench_harness["Evaluation harness<br/>[harness.py]"]
  node_bench_scoring["Benchmark scoring<br/>[scoring.py]"]
  node_bench_review["Blind review packets<br/>[review.py]"]
  node_bench_lint["Dataset linting<br/>[lint.py]"]
  node_kimi_review["Kimi review workflow<br/>[kimi_review.py]"]
end

subgraph group_model["Model runtime"]
  node_backend["MLX inference<br/>[backend.py]"]
  node_decision_scoring["Decision scoring<br/>[scoring.py]"]
  node_calibration["Probability calibration<br/>[calibration.py]"]
  node_thinking["Thinking support<br/>[thinking.py]"]
  node_thought_engine["Remote thought generation<br/>[thought_engine.py]"]
  node_torch_decision["Torch inference<br/>[torch_decision.py]"]
end

subgraph group_experience["Demo experience"]
  node_examples["Checked examples<br/>[examples.py]"]
end

node_caller(("Application caller"))

node_caller -->|"sends request"| node_playground
node_playground -.->|"validates request"| node_request_contract
node_playground -->|"maps request"| node_jev_api
node_playground -->|"handles images"| node_image_input
node_playground -->|"invokes backend"| node_backend
node_playground -->|"applies calibration"| node_calibration
node_playground -->|"configures thinking"| node_thinking
node_backend -->|"compiles questions"| node_decision_scoring
node_decision_scoring -->|"uses types"| node_request_contract
node_calibration -->|"returns results"| node_request_contract
node_thinking -->|"uses types"| node_request_contract
node_thinking -.->|"requests thoughts"| node_thought_engine
node_torch_decision -->|"uses scoring"| node_decision_scoring
node_playground -->|"loads examples"| node_examples
node_bench_cli -->|"dispatches runs"| node_bench_runner
node_bench_cli -->|"dispatches review"| node_bench_review
node_bench_cli -->|"dispatches checks"| node_bench_schema
node_bench_cli -->|"dispatches scoring"| node_bench_scoring
node_bench_cli -->|"dispatches lint"| node_bench_lint
node_bench_runner -->|"validates records"| node_bench_schema
node_bench_harness -->|"executes submissions"| node_bench_runner
node_bench_harness -->|"uses records"| node_bench_schema
node_bench_harness -->|"scores outputs"| node_bench_scoring
node_kimi_review -.->|"supports review"| node_bench_review

click node_playground "https://github.com/mohit67890/imajev/blob/main/scripts/playground/server.py"
click node_request_contract "https://github.com/mohit67890/imajev/blob/main/src/vision_decision/contracts.py"
click node_jev_api "https://github.com/mohit67890/imajev/blob/main/src/vision_decision/jev_api.py"
click node_image_input "https://github.com/mohit67890/imajev/blob/main/src/vision_decision/images.py"
click node_backend "https://github.com/mohit67890/imajev/blob/main/src/vision_decision/backend.py"
click node_decision_scoring "https://github.com/mohit67890/imajev/blob/main/src/vision_decision/scoring.py"
click node_calibration "https://github.com/mohit67890/imajev/blob/main/src/vision_decision/calibration.py"
click node_thinking "https://github.com/mohit67890/imajev/blob/main/src/vision_decision/thinking.py"
click node_thought_engine "https://github.com/mohit67890/imajev/blob/main/scripts/thought_engine.py"
click node_torch_decision "https://github.com/mohit67890/imajev/blob/main/scripts/torch_decision.py"
click node_examples "https://github.com/mohit67890/imajev/blob/main/scripts/playground/examples.py"
click node_bench_cli "https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/cli.py"
click node_bench_schema "https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/schema.py"
click node_bench_runner "https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/runner.py"
click node_bench_harness "https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/harness.py"
click node_bench_scoring "https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/scoring.py"
click node_bench_review "https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/review.py"
click node_bench_lint "https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/lint.py"
click node_kimi_review "https://github.com/mohit67890/imajev/blob/main/scripts/p3/kimi_review.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_playground,node_request_contract,node_jev_api,node_image_input toneBlue
class node_bench_cli,node_bench_schema,node_bench_runner,node_bench_harness,node_bench_scoring,node_bench_review,node_bench_lint,node_kimi_review toneAmber
class node_backend,node_decision_scoring,node_calibration,node_thinking,node_thought_engine,node_torch_decision toneMint
class node_examples toneRose
class node_caller toneIndigo
```

## Components

### Decision serving

- [HTTP playground](https://github.com/mohit67890/imajev/blob/main/scripts/playground/server.py): `scripts/playground/server.py`
- [Request contracts](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/contracts.py): `src/vision_decision/contracts.py`
- [Jev request mapping](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/jev_api.py): `src/vision_decision/jev_api.py`
- [Image handling](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/images.py): `src/vision_decision/images.py`

### ImajevBench

- [Benchmark CLI](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/cli.py): `src/imajev_bench/cli.py`
- [Dataset schema](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/schema.py): `src/imajev_bench/schema.py`
- [Submission runner](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/runner.py): `src/imajev_bench/runner.py`
- [Evaluation harness](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/harness.py): `src/imajev_bench/harness.py`
- [Benchmark scoring](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/scoring.py): `src/imajev_bench/scoring.py`
- [Blind review packets](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/review.py): `src/imajev_bench/review.py`
- [Dataset linting](https://github.com/mohit67890/imajev/blob/main/src/imajev_bench/lint.py): `src/imajev_bench/lint.py`
- [Kimi review workflow](https://github.com/mohit67890/imajev/blob/main/scripts/p3/kimi_review.py): `scripts/p3/kimi_review.py`

### Model runtime

- [MLX inference](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/backend.py): `src/vision_decision/backend.py`
- [Decision scoring](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/scoring.py): `src/vision_decision/scoring.py`
- [Probability calibration](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/calibration.py): `src/vision_decision/calibration.py`
- [Thinking support](https://github.com/mohit67890/imajev/blob/main/src/vision_decision/thinking.py): `src/vision_decision/thinking.py`
- [Remote thought generation](https://github.com/mohit67890/imajev/blob/main/scripts/thought_engine.py): `scripts/thought_engine.py`
- [Torch inference](https://github.com/mohit67890/imajev/blob/main/scripts/torch_decision.py): `scripts/torch_decision.py`

### Demo experience

- [Checked examples](https://github.com/mohit67890/imajev/blob/main/scripts/playground/examples.py): `scripts/playground/examples.py`

### Other components

- **Application caller**

## Connections

- Application caller → HTTP playground: sends request (evidence: `README.md`)
- HTTP playground → Request contracts: validates request
- HTTP playground → Jev request mapping: maps request (evidence: `scripts/playground/server.py`)
- HTTP playground → Image handling: handles images (evidence: `scripts/playground/server.py`)
- HTTP playground → MLX inference: invokes backend (evidence: `scripts/playground/server.py`)
- HTTP playground → Probability calibration: applies calibration (evidence: `scripts/playground/server.py`)
- HTTP playground → Thinking support: configures thinking (evidence: `scripts/playground/server.py`)
- MLX inference → Decision scoring: compiles questions (evidence: `src/vision_decision/backend.py`)
- Decision scoring → Request contracts: uses types (evidence: `src/vision_decision/scoring.py`)
- Probability calibration → Request contracts: returns results (evidence: `src/vision_decision/calibration.py`)
- Thinking support → Request contracts: uses types (evidence: `src/vision_decision/thinking.py`)
- Thinking support → Remote thought generation: requests thoughts
- Torch inference → Decision scoring: uses scoring (evidence: `scripts/torch_decision.py`)
- HTTP playground → Checked examples: loads examples (evidence: `scripts/playground/server.py`)
- Benchmark CLI → Submission runner: dispatches runs (evidence: `src/imajev_bench/cli.py`)
- Benchmark CLI → Blind review packets: dispatches review (evidence: `src/imajev_bench/cli.py`)
- Benchmark CLI → Dataset schema: dispatches checks (evidence: `src/imajev_bench/cli.py`)
- Benchmark CLI → Benchmark scoring: dispatches scoring (evidence: `src/imajev_bench/cli.py`)
- Benchmark CLI → Dataset linting: dispatches lint (evidence: `src/imajev_bench/cli.py`)
- Submission runner → Dataset schema: validates records (evidence: `src/imajev_bench/runner.py`)
- Evaluation harness → Submission runner: executes submissions (evidence: `src/imajev_bench/harness.py`)
- Evaluation harness → Dataset schema: uses records (evidence: `src/imajev_bench/harness.py`)
- Evaluation harness → Benchmark scoring: scores outputs (evidence: `src/imajev_bench/harness.py`)
- Kimi review workflow → Blind review packets: supports review
