Documentation
¶
Index ¶
- func AddRoutes(mux *http.ServeMux, opts ...Option)
- type ActiveModel
- type AdapterInfo
- type CapacityDevice
- type CapacityInfo
- type CapacityResponse
- type LoadRequest
- type LoadResponse
- type LocalModel
- type Option
- type RuntimeConfig
- type SlotStatus
- type StatusResponse
- type UnloadRequest
- type UnloadResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActiveModel ¶
type ActiveModel struct {
ModelName string `json:"modelName,omitempty" example:"qwen3-8b"`
Type string `json:"type,omitempty" example:"llama"`
Digest string `json:"digest,omitempty" example:"sha256:abcdef"`
Adapters []AdapterInfo `json:"adapters,omitempty" openapi_include_type:"modeldapi.AdapterInfo"`
Config RuntimeConfig `json:"config"`
Generation uint64 `json:"generation" example:"3"`
}
type AdapterInfo ¶ added in v0.33.0
type CapacityDevice ¶
type CapacityDevice struct {
Index int `json:"index"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
MemoryFree int64 `json:"memoryFree,omitempty"`
MemoryTotal int64 `json:"memoryTotal,omitempty"`
MemoryFreeKnown bool `json:"memoryFreeKnown,omitempty"`
MemoryTotalKnown bool `json:"memoryTotalKnown,omitempty"`
}
type CapacityInfo ¶
type CapacityInfo struct {
ModelMaxContext int `json:"modelMaxContext"`
EffectiveContext int `json:"effectiveContext"`
MemoryContextTokens int `json:"memoryContextTokens,omitempty"`
HotContextTokens int `json:"hotContextTokens,omitempty"`
PlannerEffectiveContext int `json:"plannerEffectiveContext,omitempty"`
KVBytesPerToken int64 `json:"kvBytesPerToken,omitempty"`
FreeBytes int64 `json:"freeBytes,omitempty"`
WeightsBytes int64 `json:"weightsBytes,omitempty"`
OverheadBytes int64 `json:"overheadBytes,omitempty"`
ReservedBytes int64 `json:"reservedBytes,omitempty"`
UserLimitBytes int64 `json:"userLimitBytes,omitempty"`
MinFreeBytes int64 `json:"minFreeBytes,omitempty"`
HostColdBudgetBytes int64 `json:"hostColdBudgetBytes,omitempty"`
UsableBytes int64 `json:"usableBytes,omitempty"`
RequiredBytes int64 `json:"requiredBytes,omitempty"`
Clamped bool `json:"clamped,omitempty"`
Reason string `json:"reason,omitempty"`
DeviceKind string `json:"deviceKind,omitempty"`
DeviceID string `json:"deviceId,omitempty"`
DeviceTotalBytes int64 `json:"deviceTotalBytes,omitempty"`
RequestedGpuLayers int `json:"requestedGpuLayers,omitempty"`
ResolvedGpuLayers int `json:"resolvedGpuLayers,omitempty"`
SparseAttention bool `json:"sparseAttention,omitempty"`
SlidingWindowAttentionTokens int `json:"slidingWindowAttentionTokens,omitempty"`
ChatTemplateFormat string `json:"chatTemplateFormat,omitempty"`
ChatTemplateThinkingStartTag string `json:"chatTemplateThinkingStartTag,omitempty"`
ChatTemplateReasoningFormat string `json:"chatTemplateReasoningFormat,omitempty"`
ChatTemplateSupportsToolCalls bool `json:"chatTemplateSupportsToolCalls,omitempty"`
ChatTemplateSupportsThinking bool `json:"chatTemplateSupportsThinking,omitempty"`
ChatTemplateSupportsReasoningEffort bool `json:"chatTemplateSupportsReasoningEffort,omitempty"`
RuntimeName string `json:"runtimeName,omitempty"`
RuntimeDigest string `json:"runtimeDigest,omitempty"`
RuntimeSystemInfo string `json:"runtimeSystemInfo,omitempty"`
SupportsGPUOffload bool `json:"supportsGpuOffload,omitempty"`
Devices []CapacityDevice `json:"devices,omitempty" openapi_include_type:"modeldapi.CapacityDevice"`
}
type CapacityResponse ¶
type CapacityResponse struct {
Model LocalModel `json:"model" openapi_include_type:"modeldapi.LocalModel"`
Info CapacityInfo `json:"info" openapi_include_type:"modeldapi.CapacityInfo"`
}
type LoadRequest ¶ added in v0.33.0
type LoadResponse ¶ added in v0.33.0
type LoadResponse struct {
Loaded bool `json:"loaded" example:"true"`
ExpectedGeneration uint64 `json:"expectedGeneration,omitempty" example:"3"`
Active ActiveModel `json:"active" openapi_include_type:"modeldapi.ActiveModel"`
}
type LocalModel ¶
type LocalModel struct {
ID string `json:"id" example:"llama:qwen3-8b"`
Model string `json:"model" example:"qwen3-8b"`
Name string `json:"name,omitempty" example:"Qwen3 8B"`
BackendID string `json:"backendId,omitempty" example:"b7d9e1a3-8f0c-4a7d-9b1e-2f3a4b5c6d7e"`
BackendName string `json:"backendName,omitempty" example:"llama"`
BackendType string `json:"backendType" example:"llama"`
Digest string `json:"digest,omitempty" example:"sha256:abcdef"`
ContextLength int `json:"contextLength,omitempty" example:"8192"`
MaxOutputTokens int `json:"maxOutputTokens,omitempty" example:"4096"`
CanChat bool `json:"canChat"`
CanEmbed bool `json:"canEmbed"`
CanPrompt bool `json:"canPrompt"`
CanStream bool `json:"canStream"`
CanThink bool `json:"canThink,omitempty"`
}
LocalModel is the browser-safe identity of a modeld-servable local model. It deliberately omits the backend BaseURL and resolved daemon filesystem path.
type Option ¶
type Option func(*handler)
Option configures modeld routes.
func WithStateReader ¶
func WithStateReader(reader stateReader) Option
WithStateReader enables registry-backed local model listing and capacity diagnostics. The reader is normally the runtime stateservice.
type RuntimeConfig ¶
type RuntimeConfig struct {
NumCtx int `json:"numCtx,omitempty"`
HotContextTokens int `json:"hotContextTokens,omitempty"`
PlannerEffectiveContext int `json:"plannerEffectiveContext,omitempty"`
NumBatch int `json:"numBatch,omitempty"`
NumThreads int `json:"numThreads,omitempty"`
NumGpuLayers int `json:"numGpuLayers,omitempty"`
TensorSplit []float32 `json:"tensorSplit,omitempty"`
FlashAttn bool `json:"flashAttn,omitempty"`
KVCacheType string `json:"kvCacheType,omitempty"`
PromptFormat string `json:"promptFormat,omitempty"`
PromptTemplateDigest string `json:"promptTemplateDigest,omitempty"`
DisableBOS bool `json:"disableBOS,omitempty"`
ReasoningFormat string `json:"reasoningFormat,omitempty"`
}
type SlotStatus ¶
type SlotStatus struct {
OwnerInstanceID string `json:"ownerInstanceId,omitempty" example:"5f2a23ad-3d9f-46dd-bc21-4c6c2f901e22"`
Backend string `json:"backend,omitempty" example:"llama"`
State string `json:"state,omitempty" example:"Ready"`
Active *ActiveModel `json:"active,omitempty" openapi_include_type:"modeldapi.ActiveModel"`
BusyOperation string `json:"busyOperation,omitempty" example:"load"`
LastError string `json:"lastError,omitempty" example:"model does not fit"`
}
type StatusResponse ¶
type StatusResponse struct {
State string `json:"state" example:"running"`
Available bool `json:"available" example:"true"`
Binary string `json:"binary,omitempty" example:"/home/user/.contenox/modeld/v0.1.0/linux-amd64/modeld"`
Endpoint string `json:"endpoint,omitempty" example:"127.0.0.1:42001"`
Instance string `json:"instance,omitempty" example:"5f2a23ad-3d9f-46dd-bc21-4c6c2f901e22"`
Backend string `json:"backend,omitempty" example:"llama"`
Error string `json:"error,omitempty" example:"modeld is not running"`
RuntimeProtocol int `json:"runtimeProtocol" example:"1"`
MinRuntimeProtocol int `json:"minRuntimeProtocol" example:"1"`
Slot *SlotStatus `json:"slot,omitempty" openapi_include_type:"modeldapi.SlotStatus"`
}
StatusResponse is Beam's curated view of modeld daemon state. It deliberately excludes filesystem paths from ActiveModel; the browser gets logical model identity and slot state, not daemon-local path details.
type UnloadRequest ¶
type UnloadRequest struct {
ExpectedGeneration *uint64 `json:"expectedGeneration" example:"3"`
}
type UnloadResponse ¶
Click to show internal directories.
Click to hide internal directories.