# ebony-vinyl/dsh-our-free-model architecture

> Architecture diagram of the GitHub repository ebony-vinyl/dsh-our-free-model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ebony-vinyl/dsh-our-free-model
- Repository: https://github.com/ebony-vinyl/dsh-our-free-model

## Overview

This repository is a dsh model-provider plugin plus a separate standalone local service. The main workflow mounts the plugin, refreshes model catalogs and availability for the host’s network, exposes routable models to the selector, and streams completions through provider adapters; users can also call a local OpenAI/Anthropic-compatible gateway. Other major capabilities include account-based channels, EAC/Kilo/aggregate lanes, routing chains, token saving, usage/settings UI, announcements, upgrades, and a separate management web app. Several relationships below are documented in the README; unsampled implementations are represented at subsystem-directory level.

Main entry points: [`src/adapter.js`](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/adapter.js) (Completion adapter), [`src/core/runtime.js`](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/core/runtime.js) (Model runtime), [`packages/standalone/service.mjs`](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/service.mjs) (Standalone service), [`index.js`](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/index.js) (Plugin mount)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin runtime"]
  node_plugin_mount["Plugin mount<br/>[index.js]"]
  node_runtime["Model runtime<br/>[runtime.js]"]
  node_selector["Model selector<br/>[adapter.js]"]
end

subgraph group_models["Model lanes"]
  node_catalog["Model catalogs<br/>[catalog.js]"]
  node_availability["Availability probe<br/>[probe.js]"]
  node_free_lane["Anonymous free lane<br/>[upstream.js]"]
  node_kilo["Kilo lane<br/>[kilo.js]"]
  node_eac["EAC lane<br/>[eac.js]"]
  node_accounts["Account channels<br/>[channel.js]"]
  node_aggregate["Aggregate providers<br/>[aggregate.js]"]
  node_combos["Fallback chains<br/>[combos.js]"]
end

subgraph group_serving["Request serving"]
  node_adapter["Completion adapter<br/>[adapter.js]"]
  node_token_saver["Token saving<br/>[index.js]"]
  node_gateway["Local API gateway<br/>[forward.js]"]
  node_anthropic_api["Anthropic API<br/>[anthropic.js]"]
end

subgraph group_management["Management"]
  node_stats[("Usage statistics<br/>[stats.js]")]
  node_settings_ui["Settings and dashboard<br/>[index.js]"]
  node_feed["Announcements<br/>[feed.js]"]
  node_updater["In-app upgrade<br/>[updater.js]"]
end

subgraph group_standalone["Standalone service"]
  node_standalone_service["Standalone service<br/>[service.mjs]"]
  node_standalone_channels["Standalone channels<br/>[worker.mjs]"]
  node_standalone_management["Management API<br/>[management.mjs]"]
  node_standalone_ui["Web management UI<br/>[app.tsx]"]
end

node_user(("dsh user"))
node_upstream_services{{"Model gateways"}}

node_user -->|"installs and uses"| node_plugin_mount
node_plugin_mount -.->|"starts runtime"| node_runtime
node_runtime -->|"builds catalogs"| node_catalog
node_runtime -->|"probes egress"| node_availability
node_runtime -.->|"publishes models"| node_selector
node_catalog -.->|"refreshes listing"| node_free_lane
node_runtime -->|"fetches sealed listing"| node_eac
node_runtime -->|"builds aggregate catalog"| node_aggregate
node_runtime -->|"builds chain catalog"| node_combos
node_selector -.->|"selects model"| node_adapter
node_adapter -->|"rewrites request"| node_token_saver
node_adapter -->|"sends completion"| node_free_lane
node_adapter -.->|"routes completion"| node_kilo
node_adapter -.->|"routes completion"| node_eac
node_adapter -.->|"routes completion"| node_accounts
node_adapter -.->|"routes completion"| node_aggregate
node_adapter -->|"resolves chain"| node_combos
node_free_lane -->|"calls gateway"| node_upstream_services
node_gateway -->|"requests completion"| node_adapter
node_gateway -->|"translates messages"| node_anthropic_api
node_user -->|"calls local API"| node_gateway
node_plugin_mount -.->|"registers controls"| node_settings_ui
node_settings_ui -.->|"reads usage"| node_stats
node_plugin_mount -.->|"provides announcements"| node_feed
node_settings_ui -.->|"triggers upgrades"| node_updater
node_user -->|"starts service"| node_standalone_service
node_standalone_service -->|"creates model runtime"| node_runtime
node_standalone_service -->|"starts API listener"| node_gateway
node_standalone_service -.->|"starts channels"| node_standalone_channels
node_standalone_service -->|"creates management API"| node_standalone_management
node_standalone_management -.->|"serves management UI"| node_standalone_ui
node_user -->|"manages service"| node_standalone_ui

click node_plugin_mount "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/index.js"
click node_runtime "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/core/runtime.js"
click node_catalog "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/catalog.js"
click node_availability "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/probe.js"
click node_free_lane "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/upstream.js"
click node_kilo "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/kilo.js"
click node_eac "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/eac.js"
click node_accounts "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/channel.js"
click node_aggregate "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/aggregate.js"
click node_combos "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/combos.js"
click node_selector "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/adapter.js"
click node_adapter "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/adapter.js"
click node_token_saver "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/token-saver/index.js"
click node_gateway "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/forward.js"
click node_anthropic_api "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/anthropic.js"
click node_stats "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/core/stats.js"
click node_settings_ui "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/index.js"
click node_feed "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/feed.js"
click node_updater "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/updater.js"
click node_standalone_service "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/service.mjs"
click node_standalone_channels "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/channels/worker.mjs"
click node_standalone_management "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/management.mjs"
click node_standalone_ui "https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/frontend/app.tsx"

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_plugin_mount,node_runtime,node_selector,node_user toneBlue
class node_catalog,node_availability,node_free_lane,node_kilo,node_eac,node_accounts,node_aggregate,node_combos toneAmber
class node_adapter,node_token_saver,node_gateway,node_anthropic_api toneMint
class node_stats,node_settings_ui,node_feed,node_updater toneRose
class node_standalone_service,node_standalone_channels,node_standalone_management,node_standalone_ui,node_upstream_services toneIndigo
```

## Components

### Plugin runtime

- [Plugin mount](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/index.js): `index.js`
- [Model runtime](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/core/runtime.js): `src/core/runtime.js`
- [Model selector](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/adapter.js): `src/adapter.js`

### Model lanes

- [Model catalogs](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/catalog.js): `src/catalog.js`
- [Availability probe](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/probe.js): `src/probe.js`
- [Anonymous free lane](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/upstream.js): `src/upstream.js`
- [Kilo lane](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/kilo.js): `src/kilo.js`
- [EAC lane](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/eac.js): `src/eac.js`
- [Account channels](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/channel.js): `src/channel.js`
- [Aggregate providers](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/aggregate.js): `src/aggregate.js`
- [Fallback chains](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/combos.js): `src/combos.js`

### Request serving

- [Completion adapter](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/adapter.js): `src/adapter.js`
- [Token saving](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/token-saver/index.js): `src/token-saver/index.js`
- [Local API gateway](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/forward.js): `src/forward.js`
- [Anthropic API](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/anthropic.js): `src/anthropic.js`

### Management

- [Usage statistics](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/core/stats.js): `src/core/stats.js`
- [Settings and dashboard](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/index.js): `index.js`
- [Announcements](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/feed.js): `src/feed.js`
- [In-app upgrade](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/src/updater.js): `src/updater.js`

### Standalone service

- [Standalone service](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/service.mjs): `packages/standalone/service.mjs`
- [Standalone channels](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/channels/worker.mjs): `packages/standalone/channels/worker.mjs`
- [Management API](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/management.mjs): `packages/standalone/management.mjs`
- [Web management UI](https://github.com/ebony-vinyl/dsh-our-free-model/blob/main/packages/standalone/frontend/app.tsx): `packages/standalone/frontend/app.tsx`

### Other components

- **dsh user**
- **Model gateways**

## Connections

- dsh user → Plugin mount: installs and uses (evidence: `README.md`)
- Plugin mount → Model runtime: starts runtime (evidence: `index.js`)
- Model runtime → Model catalogs: builds catalogs (evidence: `src/core/runtime.js`)
- Model runtime → Availability probe: probes egress (evidence: `src/core/runtime.js`)
- Model runtime → Model selector: publishes models (evidence: `src/core/runtime.js`)
- Model catalogs → Anonymous free lane: refreshes listing (evidence: `src/catalog.js`)
- Model runtime → EAC lane: fetches sealed listing (evidence: `src/core/runtime.js`)
- Model runtime → Aggregate providers: builds aggregate catalog (evidence: `src/core/runtime.js`)
- Model runtime → Fallback chains: builds chain catalog (evidence: `src/core/runtime.js`)
- Model selector → Completion adapter: selects model (evidence: `src/adapter.js`)
- Completion adapter → Token saving: rewrites request (evidence: `src/adapter.js`)
- Completion adapter → Anonymous free lane: sends completion (evidence: `src/adapter.js`)
- Completion adapter → Kilo lane: routes completion (evidence: `README.md`)
- Completion adapter → EAC lane: routes completion (evidence: `README.md`)
- Completion adapter → Account channels: routes completion (evidence: `README.md`)
- Completion adapter → Aggregate providers: routes completion (evidence: `README.md`)
- Completion adapter → Fallback chains: resolves chain (evidence: `src/adapter.js`)
- Anonymous free lane → Model gateways: calls gateway
- Local API gateway → Completion adapter: requests completion (evidence: `src/core/completion.js`)
- Local API gateway → Anthropic API: translates messages (evidence: `src/forward.js`)
- dsh user → Local API gateway: calls local API (evidence: `README.md`)
- Plugin mount → Settings and dashboard: registers controls (evidence: `index.js`)
- Settings and dashboard → Usage statistics: reads usage (evidence: `index.js`)
- Plugin mount → Announcements: provides announcements (evidence: `README.md`)
- Settings and dashboard → In-app upgrade: triggers upgrades (evidence: `README.md`)
- dsh user → Standalone service: starts service (evidence: `README.md`)
- Standalone service → Model runtime: creates model runtime (evidence: `packages/standalone/service.mjs`)
- Standalone service → Local API gateway: starts API listener (evidence: `packages/standalone/service.mjs`)
- Standalone service → Standalone channels: starts channels (evidence: `packages/standalone/service.mjs`)
- Standalone service → Management API: creates management API (evidence: `packages/standalone/service.mjs`)
- Management API → Web management UI: serves management UI (evidence: `README.md`)
- dsh user → Web management UI: manages service (evidence: `README.md`)
