Skip to main content

Module ports

Module ports 

Source
Expand description

Β§ports

Port definitions (trait abstractions) for external systems.

Ports define the interfaces that the core domain expects from infrastructure. They contain no implementation details and use only domain types.

Β§Design Rules

  • No sqlx types in any signature
  • No process/filesystem implementation details
  • Traits are minimal and CRUD-focused for repositories
  • Intent-based methods throughout (not implementation-leaking)

Modules

Re-exportsΒ§

pub use chat_history::ChatHistoryError;
pub use chat_history::ChatHistoryRepository;
pub use gguf_parser::GgufCapabilities;
pub use gguf_parser::GgufMetadata;
pub use huggingface::HfClientPort;
pub use huggingface::HfFileInfo;
pub use huggingface::HfPortError;
pub use huggingface::HfQuantInfo;
pub use huggingface::HfRepoInfo;
pub use huggingface::HfSearchOptions;
pub use huggingface::HfSearchResult;
pub use model_catalog::CatalogError;
pub use model_catalog::ModelCatalogPort;
pub use model_catalog::ModelLaunchSpec;
pub use model_catalog::ModelSummary;
pub use model_runtime::Admission;
pub use model_runtime::AdmissionLease;
pub use model_runtime::AdmissionRelease;
pub use model_runtime::LaunchOverrides;
pub use model_runtime::ModelRuntimeError;
pub use model_runtime::ModelRuntimePort;
pub use model_runtime::NoopModelRuntime;
pub use model_runtime::PinnedSpec;
pub use model_runtime::RunningTarget;
pub use model_runtime::RuntimeErrorEnvelope;

ModulesΒ§

agent πŸ”’
Agent loop port traits.
benchmark πŸ”’
Benchmark repository port definition.
chat_history
Chat history repository port definition.
download πŸ”’
Download port definitions (trait abstractions).
download_manager πŸ”’
Download manager port definition.
event_emitter πŸ”’
Event emitter trait for cross-crate event broadcasting.
gguf_parser πŸ”’
GGUF parser port definition.
huggingface
huggingface
llm_completion πŸ”’
Port definition for streaming LLM chat completions.
loop_guard_trips πŸ”’
Outbound ports for the loop guard’s log: a sink and a reader.
mcp_dto πŸ”’
MCP DTOs for cross-boundary communication (Tauri, Axum, TypeScript).
mcp_error πŸ”’
MCP service error types.
mcp_repository πŸ”’
MCP server repository trait and error types.
model_catalog
Model catalog port for listing and resolving models.
model_registrar πŸ”’
Model registrar port definition.
model_repository πŸ”’
Model repository trait definition.
model_runtime
Model runtime port for proxy model management.
process_runner πŸ”’
The two value types a model-server launch is described and tracked by.
remote_gateway πŸ”’
The proxy’s view of the remote tunnel.
retry_observer πŸ”’
Outbound port for reporting retry activity.
server_health πŸ”’
Server health status types for monitoring.
server_log_sink πŸ”’
Server log sink port for structured log capture.
settings_repository πŸ”’
Settings repository trait definition.
system_probe πŸ”’
System probe port for dependency and GPU detection.
tool_executor_filter πŸ”’
Tool Executor Filter
tool_support πŸ”’
Tool support detection port.
usage_sink πŸ”’
Outbound port for recording per-request token usage.

StructsΒ§

AgentRunOutput
Output returned by a successful AgentLoopPort::run invocation.
CompletedDownload
Information about a completed download for model registration.
DownloadManagerConfig
Configuration for creating a download manager.
DownloadRequest
Request to queue a new download.
EmptyToolExecutor
A ToolExecutorPort that exposes no tools and rejects all execution.
FilteredToolExecutor
Decorator that restricts a ToolExecutorPort to a named allowlist.
NoopEmitter
A no-op event emitter for tests and CLI contexts.
NoopGgufParser
A no-op GGUF parser that returns default/empty metadata.
ProcessHandle
Handle to a running server process.
Repos
Container for all repository trait objects.
Resolution
Result of resolving files for a quantization.
ResolutionAttempt
A single resolution attempt for diagnostics.
ResolutionStatus
Result of executable path resolution for a server.
ResolvedFile
A single resolved file.
ServerConfig
Configuration for starting a model server.
ToolSupportDetection
Result of tool support detection.
ToolSupportDetectionInput
Input for tool support detection.

EnumsΒ§

AgentError
Errors that terminate the agentic loop.
CoreError
Core error type for semantic domain errors.
GgufParseError
Errors that can occur during GGUF parsing.
JinjaMode
What position a launch takes on Jinja chat templating.
McpRepositoryError
Domain-specific errors for MCP repository operations.
McpServiceError
Domain-specific errors for MCP service operations.
ModelSource
The source/provider of the model being analyzed.
RepositoryError
Domain-specific errors for repository operations.
ServerHealthStatus
Health status of a running server process.
ToolFormat
Tool calling format detected.

ConstantsΒ§

TOOL_NOT_AVAILABLE_MSG
Sentinel phrase embedded in every tool-rejection error produced by this module.

TraitsΒ§

AgentLoopPort
Port: drives the full backend agentic loop.
AppEventEmitter
Trait for emitting application events.
BenchmarkRepositoryPort
Repository interface for benchmark persistence.
DownloadManagerPort
GgufParserPort
Port for parsing GGUF file metadata.
LlmCompletionPort
Port that the agent loop uses to drive a streaming LLM.
LoopGuardTripLog
Reads the loop guard’s log back.
LoopGuardTripSink
Where the loop guard’s step records what it did.
McpServerRepository
Repository trait for MCP server persistence.
ModelRegistrarPort
Port for registering downloaded models in the database.
ModelRepository
Repository for model persistence operations.
QuantizationResolver
Trait for resolving quantization-specific files from a model repository.
RemoteGatewayPort
What the proxy may ask the tunnel’s owner.
RetryObserver
A sink for retry activity on a request that is being re-attempted.
ServerLogSinkPort
Port for appending server log lines to a sink.
SettingsRepository
Repository for application settings persistence.
SystemProbePort
Port for probing system dependencies and hardware.
ToolExecutorPort
Port: dispatches tool calls to the underlying execution backend.
ToolSupportDetectorPort
Port for detecting tool/function calling support in models.
UsageSink
A sink for one completed request’s token usage.

Type AliasesΒ§

SettingsChange
A change to stored settings: given them as they stand, alter them in place or refuse. What SettingsRepository::modify applies, and free to borrow what it needs for 'a.