@codesoul-co/hypha-inference / drivers
- Package index:
@codesoul-co/hypha-inference - Source:
packages/inference/src/drivers.ts - Exports: 14
Using this module
Use the Drivers module for using the public contracts and operations for this capability boundary. It exports 3 classes, 7 interfaces, 4 types.
Import from the package entrypoint
import {
HttpLocalInferenceDriver,
LocalInferenceDriverRegistry,
NodeLocalInferenceProcessSupervisor,
} from '@codesoul-co/hypha-inference';
import type {
LocalInferenceDriver,
LocalInferenceDriverConfig,
LocalInferenceDriverStatus,
LocalInferenceHealthProbeRequest,
LocalInferenceProcessHandle,
LocalInferenceProcessSpec,
LocalInferenceProcessSupervisor,
LocalInferenceDriverMode,
} from '@codesoul-co/hypha-inference';
// The complete export list is documented below.Usage patterns
- Use the 11 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 3 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
HttpLocalInferenceDriver | class | new HttpLocalInferenceDriver(config: LocalInferenceDriverConfig, supervisor?: LocalInferenceProcessSupervisor, healthProbe?: LocalInferenceHealthProbe): HttpLocalInferenceDriver | Http Local Inference Driver class with 10 public constructor or member entries; its exact declarations are listed below. |
LocalInferenceDriverRegistry | class | new LocalInferenceDriverRegistry(): LocalInferenceDriverRegistry | Local Inference Driver Registry class with 6 public constructor or member entries; its exact declarations are listed below. |
NodeLocalInferenceProcessSupervisor | class | new NodeLocalInferenceProcessSupervisor(): NodeLocalInferenceProcessSupervisor | Node Local Inference Process Supervisor class with 2 public constructor or member entries; its exact declarations are listed below. |
LocalInferenceDriver | interface | interface LocalInferenceDriver | Local Inference Driver interface with 9 public fields or methods. |
LocalInferenceDriverConfig | interface | interface LocalInferenceDriverConfig | Local Inference Driver Config interface with 17 public fields or methods. |
LocalInferenceDriverStatus | interface | interface LocalInferenceDriverStatus | Local Inference Driver Status interface with 9 public fields or methods. |
LocalInferenceHealthProbeRequest | interface | interface LocalInferenceHealthProbeRequest | Local Inference Health Probe Request interface with 3 public fields or methods. |
LocalInferenceProcessHandle | interface | interface LocalInferenceProcessHandle | Local Inference Process Handle interface with 3 public fields or methods. |
LocalInferenceProcessSpec | interface | interface LocalInferenceProcessSpec | Local Inference Process Spec interface with 4 public fields or methods. |
LocalInferenceProcessSupervisor | interface | interface LocalInferenceProcessSupervisor | Local Inference Process Supervisor interface with 1 public fields or methods. |
LocalInferenceDriverMode | type | type LocalInferenceDriverMode = 'connect' | 'managed' | Public type alias for Local Inference Driver Mode; the declaration contains its complete type expression. |
LocalInferenceDriverState | type | type LocalInferenceDriverState = 'idle' | 'starting' | 'ready' | 'stopping' | 'stopped' | 'failed' | Public type alias for Local Inference Driver State; the declaration contains its complete type expression. |
LocalInferenceEngineKind | type | type LocalInferenceEngineKind = 'ollama' | 'sglang' | 'vllm' | Public type alias for Local Inference Engine Kind; the declaration contains its complete type expression. |
LocalInferenceHealthProbe | type | type LocalInferenceHealthProbe = (request: LocalInferenceHealthProbeRequest) => Promise<boolean> | Public type alias for Local Inference Health Probe; the declaration contains its complete type expression. |
HttpLocalInferenceDriver
Http Local Inference Driver class with 10 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { HttpLocalInferenceDriver } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export declare class HttpLocalInferenceDriver implements LocalInferenceDriver {
readonly id: string;
readonly kind: LocalInferenceEngineKind;
constructor(config: LocalInferenceDriverConfig, supervisor?: LocalInferenceProcessSupervisor, healthProbe?: LocalInferenceHealthProbe);
start(model?: string | undefined): Promise<LocalInferenceDriverStatus>;
load(model: string): Promise<LocalInferenceDriverStatus>;
unload(model?: string | undefined): Promise<LocalInferenceDriverStatus>;
stop(): Promise<LocalInferenceDriverStatus>;
health(): Promise<boolean>;
status(): LocalInferenceDriverStatus;
backend(): InferenceBackend;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
backend | method | backend(): InferenceBackend | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (config: LocalInferenceDriverConfig, supervisor?: LocalInferenceProcessSupervisor, healthProbe?: LocalInferenceHealthProbe): HttpLocalInferenceDriver | Creates an instance of this class. |
health | method | health(): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
id | property | readonly id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | readonly kind: LocalInferenceEngineKind | Public property; its type, readonly modifier and optionality are shown in the signature. |
load | method | load(model: string): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
start | method | start(model?: string | undefined): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
status | method | status(): LocalInferenceDriverStatus | Public method; parameters and return type are shown in the signature. |
stop | method | stop(): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
unload | method | unload(model?: string | undefined): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
LocalInferenceDriverRegistry
Local Inference Driver Registry class with 6 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { LocalInferenceDriverRegistry } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export declare class LocalInferenceDriverRegistry {
register(driver: LocalInferenceDriver): void;
get(id: string): LocalInferenceDriver | null;
require(id: string): LocalInferenceDriver;
list(): LocalInferenceDriver[];
stopAll(): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): LocalInferenceDriverRegistry | Creates an instance of this class. |
get | method | get(id: string): LocalInferenceDriver | null | Public method; parameters and return type are shown in the signature. |
list | method | list(): LocalInferenceDriver[] | Public method; parameters and return type are shown in the signature. |
register | method | register(driver: LocalInferenceDriver): void | Public method; parameters and return type are shown in the signature. |
require | method | require(id: string): LocalInferenceDriver | Public method; parameters and return type are shown in the signature. |
stopAll | method | stopAll(): Promise<void> | Public method; parameters and return type are shown in the signature. |
NodeLocalInferenceProcessSupervisor
Node Local Inference Process Supervisor class with 2 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { NodeLocalInferenceProcessSupervisor } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export declare class NodeLocalInferenceProcessSupervisor implements LocalInferenceProcessSupervisor {
start(spec: LocalInferenceProcessSpec): Promise<LocalInferenceProcessHandle>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): NodeLocalInferenceProcessSupervisor | Creates an instance of this class. |
start | method | start(spec: LocalInferenceProcessSpec): Promise<LocalInferenceProcessHandle> | Public method; parameters and return type are shown in the signature. |
LocalInferenceDriver
Local Inference Driver interface with 9 public fields or methods.
- Kind: interface
- Import:
import type { LocalInferenceDriver } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export interface LocalInferenceDriver {
readonly id: string;
readonly kind: LocalInferenceEngineKind;
start(model?: string): Promise<LocalInferenceDriverStatus>;
load(model: string): Promise<LocalInferenceDriverStatus>;
unload(model?: string): Promise<LocalInferenceDriverStatus>;
stop(): Promise<LocalInferenceDriverStatus>;
health(): Promise<boolean>;
status(): LocalInferenceDriverStatus;
backend(): InferenceBackend;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
backend | method | backend(): InferenceBackend | Public method; parameters and return type are shown in the signature. |
health | method | health(): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
id | property | readonly id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | readonly kind: LocalInferenceEngineKind | Public property; its type, readonly modifier and optionality are shown in the signature. |
load | method | load(model: string): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
start | method | start(model?: string): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
status | method | status(): LocalInferenceDriverStatus | Public method; parameters and return type are shown in the signature. |
stop | method | stop(): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
unload | method | unload(model?: string): Promise<LocalInferenceDriverStatus> | Public method; parameters and return type are shown in the signature. |
LocalInferenceDriverConfig
Local Inference Driver Config interface with 17 public fields or methods.
- Kind: interface
- Import:
import type { LocalInferenceDriverConfig } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export interface LocalInferenceDriverConfig {
id?: string;
kind: LocalInferenceEngineKind;
mode?: LocalInferenceDriverMode;
baseUrl?: string;
endpoint?: string;
model?: string;
host?: string;
port?: number;
command?: string;
args?: string[];
cwd?: string;
env?: Record<string, string>;
startupTimeoutMs?: number;
healthPollMs?: number;
requestTimeoutMs?: number;
apiKey?: string;
apiKeyEnv?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
apiKey | property | apiKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
apiKeyEnv | property | apiKeyEnv?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
args | property | args?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
baseUrl | property | baseUrl?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
command | property | command?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
cwd | property | cwd?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
endpoint | property | endpoint?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
env | property | env?: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
healthPollMs | property | healthPollMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
host | property | host?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: LocalInferenceEngineKind | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode?: LocalInferenceDriverMode | Public property; its type, readonly modifier and optionality are shown in the signature. |
model | property | model?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
port | property | port?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
requestTimeoutMs | property | requestTimeoutMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
startupTimeoutMs | property | startupTimeoutMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
LocalInferenceDriverStatus
Local Inference Driver Status interface with 9 public fields or methods.
- Kind: interface
- Import:
import type { LocalInferenceDriverStatus } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export interface LocalInferenceDriverStatus {
id: string;
kind: LocalInferenceEngineKind;
mode: LocalInferenceDriverMode;
state: LocalInferenceDriverState;
baseUrl: string;
model?: string;
pid?: number;
healthy: boolean;
error?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
baseUrl | property | baseUrl: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
error | property | error?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
healthy | property | healthy: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: LocalInferenceEngineKind | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode: LocalInferenceDriverMode | Public property; its type, readonly modifier and optionality are shown in the signature. |
model | property | model?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
pid | property | pid?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
state | property | state: LocalInferenceDriverState | Public property; its type, readonly modifier and optionality are shown in the signature. |
LocalInferenceHealthProbeRequest
Local Inference Health Probe Request interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { LocalInferenceHealthProbeRequest } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export interface LocalInferenceHealthProbeRequest {
url: string;
headers: Record<string, string>;
timeoutMs: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
headers | property | headers: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
timeoutMs | property | timeoutMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
url | property | url: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
LocalInferenceProcessHandle
Local Inference Process Handle interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { LocalInferenceProcessHandle } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export interface LocalInferenceProcessHandle {
readonly pid?: number;
readonly exited: Promise<{
code: number | null;
signal: NodeJS.Signals | null;
}>;
stop(graceMs?: number): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
exited | property | readonly exited: Promise<{ code: number | null; signal: NodeJS.Signals | null; }> | Public property; its type, readonly modifier and optionality are shown in the signature. |
pid | property | readonly pid?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
stop | method | stop(graceMs?: number): Promise<void> | Public method; parameters and return type are shown in the signature. |
LocalInferenceProcessSpec
Local Inference Process Spec interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { LocalInferenceProcessSpec } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export interface LocalInferenceProcessSpec {
command: string;
args: string[];
cwd?: string;
env?: Record<string, string>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
args | property | args: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
command | property | command: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
cwd | property | cwd?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
env | property | env?: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
LocalInferenceProcessSupervisor
Local Inference Process Supervisor interface with 1 public fields or methods.
- Kind: interface
- Import:
import type { LocalInferenceProcessSupervisor } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export interface LocalInferenceProcessSupervisor {
start(spec: LocalInferenceProcessSpec): Promise<LocalInferenceProcessHandle>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
start | method | start(spec: LocalInferenceProcessSpec): Promise<LocalInferenceProcessHandle> | Public method; parameters and return type are shown in the signature. |
LocalInferenceDriverMode
Public type alias for Local Inference Driver Mode; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { LocalInferenceDriverMode } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export type LocalInferenceDriverMode = 'connect' | 'managed';LocalInferenceDriverState
Public type alias for Local Inference Driver State; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { LocalInferenceDriverState } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export type LocalInferenceDriverState = 'idle' | 'starting' | 'ready' | 'stopping' | 'stopped' | 'failed';LocalInferenceEngineKind
Public type alias for Local Inference Engine Kind; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { LocalInferenceEngineKind } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export type LocalInferenceEngineKind = 'ollama' | 'sglang' | 'vllm';LocalInferenceHealthProbe
Public type alias for Local Inference Health Probe; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { LocalInferenceHealthProbe } from '@codesoul-co/hypha-inference'; - Source module:
drivers
Declaration
export type LocalInferenceHealthProbe = (request: LocalInferenceHealthProbeRequest) => Promise<boolean>;