Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ one, and both report live GPU and memory use throughout.
| **Architectures** | x64 and arm64 on all three. Windows on ARM is experimental. |
| **Installers** | Windows `.exe`; Linux `.deb`; macOS `.dmg`. On other Linux distributions, [build from source](docs/building.mdx). |
| **Mixing nodes** | Windows, Linux, and macOS nodes can all be paired with each other |
| **Inference engines** | Ollama, LM Studio, llama.cpp, and vLLM (Linux with an NVIDIA GPU, or Apple Silicon macOS) |
| **Inference engines** | Ollama, LM Studio, llama.cpp, and vLLM (Linux with an NVIDIA GPU, or Apple Silicon macOS), Strata (Linux - detected and managed) |

**PAIR running on a machine does not mean an engine will.** PAIR itself runs on
any supported Windows, Linux, or macOS machine. Each engine sets its own requirements
Expand Down
2 changes: 1 addition & 1 deletion desktop/docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ not select or pin proxy routes.
An NVPAIR-launched engine binds to loopback and is never directly LAN-reachable.
Peers reach it only through the node's proxy over a cluster-mTLS ingress, so
discovery advertises the promoted proxy port for `ol`/`lm` rather than the
engine's private port; llama.cpp uses the additional `lc` key and vLLM the `vl` key. Transport
engine's private port; llama.cpp uses the additional `lc` key, vLLM the `vl` key, and Strata the `st` key. Transport
security is backend-owned; Electron only
reflects the advertised proxy port and reads a remote engine's real port from
`engine:remote-get-installed` facts.
Expand Down
3 changes: 2 additions & 1 deletion desktop/docs/frontend-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ They do not imply a WebSocket connection. Browser clients are not supported.
- `onSettingsDisconnected(callback)` reports that a node's settings authority
became unreachable, so its cached snapshot is stale.

`EngineType` currently includes `ollama`, `lm-studio`, `llama-cpp`, and `vllm`.
`EngineType` currently includes `ollama`, `lm-studio`, `llama-cpp`, `vllm`,
and `strata`.
vLLM serves one model per process, so `unloadModel` (Eject) stops the engine,
which frees its GPU memory, and `loadModel` on a stopped engine starts it. Its model
list is the Hugging Face cache, which stays available while the engine is stopped, `deleteModel` removes a cached model (not the one
Expand Down
4 changes: 2 additions & 2 deletions desktop/docs/services-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ previews collected by services.
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| `app:ready` | Complete broker startup and refresh snapshots | `state:request-refresh` |
| `discovery:nodes-changed` | Replace discovery snapshot and diff nodes | `discovery:nodes-changed`, `nodes:upsert`, `nodes:remove` |
| `ollama-proxy:ready` / `lmstudio-proxy:ready` / `llamacpp-proxy:ready` / `vllm-proxy:ready` | Record engine proxy port | `engines:state-changed` |
| `ollama-proxy:ready` / `lmstudio-proxy:ready` / `llamacpp-proxy:ready` / `vllm-proxy:ready` / `strata-proxy:ready` | Record engine proxy port | `engines:state-changed` |
| proxy `node/*` | Update per-engine node presence; the advertised port is the peer's promoted proxy port (not the engine's private loopback port) | node and engine pushes |
| `engine:ready` / `engine:state-changed` | Update engine facts and models | `engines:state-changed` |
| `engine:settings-changed` | Validate and republish the owning node's settings snapshot | `engines:settings-changed` |
Expand Down Expand Up @@ -296,7 +296,7 @@ reachability verdict of its own. Failed hardware collection leaves the last
accepted sample aging and never independently marks a node offline.

The model catalogue is backend-owned. `nvpair-engine-manager` serves the curated
Ollama, LM Studio, and llama.cpp lists over `engine:catalog`, filtered for the
Ollama, LM Studio, llama.cpp, vLLM, and Strata lists over `engine:catalog`, filtered for the
operating system and CPU a model will install on; Electron relays the call and
maps rows for the renderer, which then sends pull-ready model IDs back through
the engine manager. llama.cpp's source is also searchable: the relay passes the
Expand Down
1 change: 1 addition & 0 deletions desktop/docs/services-parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ history.
| LM Studio routing | Complete | Parallel broker relay and scheduler path |
| llama.cpp backend | Integrated | Desktop and TUI expose install, lifecycle, catalog pull, inventory, load/unload, endpoints, routing, and demo traffic |
| vLLM engine | Integrated (Linux, macOS arm64) | Desktop and TUI expose install, lifecycle, the cached-model list, switching the served model (Load), Hugging Face catalog search and download, endpoints and routing; eject (stops the engine), delete of cached models; no demo traffic |
| Strata engine | Detected (Linux) | Desktop and TUI expose lifecycle, the locked `family/quant` catalog, download while stopped, and switching the served model (Load); no install, uninstall, or model delete yet |
| Local engine lifecycle | Complete | Install, start, stop, uninstall, update, and port configuration |
| Remote engine lifecycle | Partial | Remote install, start, stop, status, and model pull are supported |
| Engine models | Partial | Core list, pull, load, unload, and supported delete actions are wired |
Expand Down
28 changes: 28 additions & 0 deletions desktop/src/electron/service-bridge/engine-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,39 @@ function config(value: JsonValue | undefined): EngineSettingsConfig {
...(modelSource ? { modelSource } : {})
}
}
function stringList(value: JsonValue | undefined): string[] {
if (value === undefined) return []
if (!Array.isArray(value)) throw new Error('Invalid engine settings response.')
return value.map(entry => {
if (typeof entry !== 'string') throw new Error('Invalid engine settings response.')
return entry
})
}
function external(value: JsonValue | undefined): EngineSettingsSnapshot['external'] | undefined {
if (!value) return undefined
const row = object(value)
const preset = text(row.preset)
const host = text(row.host)
const model = text(row.model)
const readyFile = text(row.readyFile)
const configFile = text(row.configFile)
return {
...(preset ? { preset } : {}),
...(host ? { host } : {}),
port: number(row.port),
...(model ? { model } : {}),
launchArgs: stringList(row.launch_args),
...(readyFile ? { readyFile } : {}),
...(configFile ? { configFile } : {})
}
}
export function parseEngineSettings(value: JsonValue | undefined): EngineSettingsSnapshot {
const row = object(value)
const engine = row.engine
const phase = row.phase
if (!isSettingsEngine(engine) || !isSnapshotPhase(phase) || !text(row.epoch))
throw new Error('Invalid engine settings response.')
const ext = external(row.external)
return {
nodeId: text(row.nodeId),
engine,
Expand All @@ -68,6 +95,7 @@ export function parseEngineSettings(value: JsonValue | undefined): EngineSetting
effectiveProxyPort: number(row.effectiveProxyPort),
running: flag(row.running),
adopted: flag(row.adopted),
...(ext ? { external: ext } : {}),
editable: flag(row.editable),
reason: text(row.reason),
// Preserve the target's argument format so incompatible devices stay read-only.
Expand Down
14 changes: 9 additions & 5 deletions desktop/src/electron/service-bridge/modular-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ function emptyEngines(): Record<ProxyEngine, EnginePresence> {
ollama: emptyPresence(),
'lm-studio': emptyPresence(),
'llama-cpp': emptyPresence(),
vllm: emptyPresence()
vllm: emptyPresence(),
strata: emptyPresence()
}
}

Expand Down Expand Up @@ -954,7 +955,8 @@ class ModularBridgeState {
ollama: 0,
'lm-studio': 0,
'llama-cpp': 0,
vllm: 0
vllm: 0,
strata: 0
}
private selfId: string | null = null
/**
Expand Down Expand Up @@ -2018,10 +2020,12 @@ class ModularBridgeState {
// Per-engine attribution is authoritative when the node carries any:
// return exactly this engine's models so a dual-engine node attributes
// each model to the engine that serves it, and a missing key means this
// engine serves none (NOT the cross-engine union). Mirrors
// noderec.DirectoryNode.EngineModels.
// engine serves none (NOT the cross-engine union). Base list mirrors
// noderec.DirectoryNode.EngineModels; the append below is display-side.
if (Object.keys(node.modelsByEngine).length > 0) {
return node.modelsByEngine[engineManagerName(engine)] ?? []
const rows = node.modelsByEngine[engineManagerName(engine)] ?? []
const loaded = node.loadedByEngine[engineManagerName(engine)] ?? []
return [...rows, ...loaded.filter(name => !rows.includes(name))]
}
// Fallback for a pre-attribution peer: the flat union is unattributed, so
// attribute it only when exactly one proxy engine is active on the node,
Expand Down
13 changes: 11 additions & 2 deletions desktop/src/electron/service-bridge/proxy-engines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ import { engineTypeFromManagerName } from '@/shared/utils/engines'
* separate from the complete engine registry so an engine can be declared
* before every proxy-state consumer is ready to handle it.
*/
export type ProxyEngine = Extract<EngineType, 'ollama' | 'lm-studio' | 'llama-cpp' | 'vllm'>
export type ProxyEngine = Extract<
EngineType,
'ollama' | 'lm-studio' | 'llama-cpp' | 'vllm' | 'strata'
>
/** A proxy's source name: the engine-manager's name for the engine, plus -proxy. */
export type ProxyNodeSource = `${(typeof EngineManagerNames)[ProxyEngine]}-proxy`

const PROXY_SOURCE_SUFFIX = '-proxy'

export const PROXY_ENGINES: readonly ProxyEngine[] = ['ollama', 'lm-studio', 'llama-cpp', 'vllm']
export const PROXY_ENGINES: readonly ProxyEngine[] = [
'ollama',
'lm-studio',
'llama-cpp',
'vllm',
'strata'
]

export const PROXY_NODE_SOURCES: readonly ProxyNodeSource[] =
PROXY_ENGINES.map(proxySourceForEngine)
Expand Down
22 changes: 17 additions & 5 deletions desktop/src/shared/constants/engines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ import { EngineType, ModelExpiry } from '@/shared/types/engines'

// The engines `nvpair-engine-manager` ships a manifest for, and therefore the
// only ones PAIR can install, run or route to.
export const EngineTypes = ['ollama', 'lm-studio', 'llama-cpp', 'vllm'] as const
export const EngineTypes = ['ollama', 'lm-studio', 'llama-cpp', 'vllm', 'strata'] as const

// Kept as a distinct export so a future engine can ship behind it rather than
// appearing the moment its type exists.
export const EnabledEngineTypes: EngineType[] = ['ollama', 'lm-studio', 'llama-cpp', 'vllm']
export const EnabledEngineTypes: EngineType[] = [
'ollama',
'lm-studio',
'llama-cpp',
'vllm',
'strata'
]

/**
* Engines whose model list is read from disk, so it is available while the engine
* is stopped. For every other engine the list comes from the running engine and is
* cleared when it stops. Stopped engines keep that inventory internally; the UI
* exposes model controls only while enabled.
*/
export const EnginesListingModelsWhenStopped: readonly EngineType[] = ['vllm']
export const EnginesListingModelsWhenStopped: readonly EngineType[] = ['vllm', 'strata']

/**
* How `nvpair-engine-manager` spells each engine on the wire. This is the
Expand All @@ -28,7 +34,8 @@ export const EngineManagerNames = {
ollama: 'ollama',
'lm-studio': 'lmstudio',
'llama-cpp': 'llamacpp',
vllm: 'vllm'
vllm: 'vllm',
strata: 'strata'
} as const satisfies Record<EngineType, string>

export const EngineSources = ['bundled', 'detected', 'installed'] as const
Expand All @@ -37,7 +44,8 @@ export const EngineDisplayNames: Record<EngineType, string> = {
ollama: 'Ollama',
'lm-studio': 'LM Studio',
'llama-cpp': 'llama.cpp',
vllm: 'vLLM'
vllm: 'vLLM',
strata: 'Strata'
} as const

/** Default docs/install URLs for built-in backends. Single source of truth for UI and adapter buildInfo(). */
Expand All @@ -51,6 +59,10 @@ export const EngineDefaultLinks: Record<EngineType, { docsUrl: string; installUr
vllm: {
docsUrl: 'https://docs.vllm.ai/',
installUrl: 'https://docs.vllm.ai/en/latest/getting_started/installation.html'
},
strata: {
docsUrl: 'https://github.com/Niko1221/Strata#readme',
installUrl: 'https://github.com/Niko1221/Strata/releases/latest'
}
} as const

Expand Down
11 changes: 11 additions & 0 deletions desktop/src/shared/types/engine-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface EngineSettingsSnapshot extends EngineSettingsTarget {
effectiveProxyPort: number
running: boolean
adopted: boolean
external?: EngineExternalInstance
editable: boolean
reason: string
format: string
Expand All @@ -42,6 +43,16 @@ export interface EngineSettingsSnapshot extends EngineSettingsTarget {
requestId: string
}

export interface EngineExternalInstance {
preset?: string
host?: string
port: number
model?: string
launchArgs: string[]
readyFile?: string
configFile?: string
}

export interface EngineSettingsPreview {
settings: EngineSettingsConfig
revision: number
Expand Down
3 changes: 2 additions & 1 deletion desktop/src/shared/types/inference-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export const DEMO_ENGINE_PROBES: readonly {
}[] = [
{ backend: 'ollama', proxyEngine: 'ollama' },
{ backend: 'lmstudio', proxyEngine: 'lm-studio' },
{ backend: 'llamacpp', proxyEngine: 'llama-cpp' }
{ backend: 'llamacpp', proxyEngine: 'llama-cpp' },
{ backend: 'strata', proxyEngine: 'strata' }
]

/**
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/shared/types/inference-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* reads its `--list-models` inventory.
*/

export type DispatcherBackend = 'ollama' | 'lmstudio' | 'llamacpp'
export type DispatcherBackend = 'ollama' | 'lmstudio' | 'llamacpp' | 'strata'

/** One entry from the binary's `--list-models` JSON inventory. */
export interface DispatcherModel {
Expand Down
12 changes: 12 additions & 0 deletions desktop/src/ui/assets/engine-icons/strata.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions desktop/src/ui/components/BackendRow/EngineSettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,31 @@ export function EngineSettingsSection({
must be changed on the device running the engine.
</Text>
)}
{snapshot?.external && (
<Stack gap="1">
<Text kind="body/semibold/sm">
External instance (started outside PAIR)
</Text>
<Text kind="body/regular/sm">
{`Listening on ${snapshot.external.host ?? '127.0.0.1'}:${snapshot.external.port}`}
{snapshot.external.model ? ` · ${snapshot.external.model}` : ''}
{snapshot.external.preset
? ` · profile: ${snapshot.external.preset}`
: ''}
</Text>
{snapshot.external.launchArgs.length > 0 && (
<TextArea
size="small"
aria-label="External instance arguments"
value={snapshot.external.launchArgs.join(' ')}
rows={3}
resizeable="auto"
disabled
className="font-mono"
/>
)}
</Stack>
)}
<Flex gap="3">
<FormField slotLabel="Server port">
<TextInput
Expand Down
16 changes: 7 additions & 9 deletions desktop/src/ui/components/EndpointContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { EnabledEngineTypes, EngineDisplayNames } from '@/shared/constants/engin
import { useCallback, useMemo, useState } from 'react'
import EngineIcon from './EngineIcon'
import { DismissibleTooltip } from '@/ui/components/DismissibleTooltip/DismissibleTooltip'
import { getEnginesForNode, isEngineTypeRunningClusterWide } from '@/ui/utils/get-engines-for-node'
import {
endpointProxyPortForNode,
isEngineTypeRunningClusterWide
} from '@/ui/utils/get-engines-for-node'
import { gatewayEndpointDisplayUrl } from '@/ui/utils/gateway-inference-paths'
import type { EngineType } from '@/shared/types/engines'

Expand All @@ -32,20 +35,15 @@ export default function EndpointContent({
createCopiedState(EnabledEngineTypes)
)
const statusByNode = useEngineStatusStore(s => s.statusByNode)
const selfEngines = useMemo(
() => getEnginesForNode(selfId, statusByNode, EnabledEngineTypes),
[selfId, statusByNode]
)
const allBackends = useMemo(() => {
const engines = EnabledEngineTypes.map(type => {
const backend = selfEngines.find(b => b.engineType === type)
const isAvailable = isEngineTypeRunningClusterWide(statusByNode, type)
const port = endpointProxyPortForNode(selfId, statusByNode, type)

if (!backend || !backend.proxyPort || !isAvailable) {
if (!port || !isAvailable) {
return null
}

const port = backend.proxyPort
return {
name: EngineDisplayNames[type],
proxyPort: port,
Expand All @@ -59,7 +57,7 @@ export default function EndpointContent({
}

return engines
}, [selfEngines, statusByNode])
}, [selfId, statusByNode])

const handleCopy = useCallback(async (value: string, backend: string) => {
const electronCopy = window.windowApi?.window?.copyToClipboard
Expand Down
4 changes: 3 additions & 1 deletion desktop/src/ui/components/EngineIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import ollamaIcon from '@/ui/assets/engine-icons/ollama.png?inline'
import lmStudioIcon from '@/ui/assets/engine-icons/lm-studio.png?inline'
import llamaCppIcon from '@/ui/assets/engine-icons/llama-cpp.svg?inline'
import vllmIcon from '@/ui/assets/engine-icons/vllm.svg?inline'
import strataIcon from '@/ui/assets/engine-icons/strata.svg?inline'

const engineIcons: Record<EngineType, string> = {
ollama: ollamaIcon,
'lm-studio': lmStudioIcon,
'llama-cpp': llamaCppIcon,
vllm: vllmIcon
vllm: vllmIcon,
strata: strataIcon
}

export default function EngineIcon({ type, size = 32 }: { type: EngineType; size?: number }) {
Expand Down
Loading