Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultSchemasDir() (string, error)
- func IsKnownMessageType(typ MessageType) bool
- func Marshal(envelope Envelope) ([]byte, error)
- type ChatMessage
- type ChatRequest
- type Envelope
- type GPUStatus
- type JobAcceptedPayload
- type JobCancelPayload
- type JobCompletedPayload
- type JobFailedPayload
- type JobOfferPayload
- type JobRejectedPayload
- type JobStartedPayload
- type JobVerification
- type MessageType
- type ModelAssignPayload
- type ModelDownloadProgressPayload
- type ModelReadyPayload
- type ModelUnloadPayload
- type NodeConfigUpdatedPayload
- type NodeDrainPayload
- type NodeHeartbeatPayload
- type NodeHelloPayload
- type NodeLogEventPayload
- type NodeSafetyEventPayload
- type NodeSignature
- type NodeStateChangedPayload
- type RuntimeUpdateAvailablePayload
- type SessionAcceptedPayload
- type Usage
- type Validator
Constants ¶
View Source
const Version = "1.0"
Variables ¶
View Source
var RequiredMessageTypes = []MessageType{ TypeNodeHello, TypeNodeHeartbeat, TypeNodeStateChanged, TypeModelDownloadProgress, TypeModelReady, TypeJobAccepted, TypeJobRejected, TypeJobStarted, TypeJobCompleted, TypeJobFailed, TypeNodeSafetyEvent, TypeNodeLogEvent, TypeSessionAccepted, TypeNodeConfigUpdated, TypeModelAssign, TypeModelUnload, TypeJobOffer, TypeJobCancel, TypeNodeDrain, TypeRuntimeUpdateAvailable, }
Functions ¶
func DefaultSchemasDir ¶
func IsKnownMessageType ¶
func IsKnownMessageType(typ MessageType) bool
Types ¶
type ChatMessage ¶
type ChatRequest ¶
type ChatRequest struct {
Messages []ChatMessage `json:"messages"`
Temperature *float64 `json:"temperature,omitempty"`
MaxTokens int `json:"max_tokens"`
Seed *int64 `json:"seed,omitempty"`
Stream bool `json:"stream"`
}
type Envelope ¶
type Envelope struct {
ProtocolVersion string `json:"protocol_version"`
MessageID string `json:"message_id"`
Type MessageType `json:"type"`
SentAt time.Time `json:"sent_at"`
Payload json.RawMessage `json:"payload"`
}
func NewEnvelope ¶
type JobAcceptedPayload ¶
type JobCancelPayload ¶
type JobCompletedPayload ¶
type JobCompletedPayload struct {
JobID string `json:"job_id"`
AttemptID string `json:"attempt_id"`
ModelID string `json:"model_id"`
RuntimeHash string `json:"runtime_hash"`
ModelHash string `json:"model_hash"`
Message *ChatMessage `json:"message,omitempty"`
Usage Usage `json:"usage"`
DurationMillis int64 `json:"duration_millis"`
FinishReason string `json:"finish_reason"`
CompletedAt time.Time `json:"completed_at"`
Signature *NodeSignature `json:"signature,omitempty"`
}
type JobFailedPayload ¶
type JobOfferPayload ¶
type JobOfferPayload struct {
JobID string `json:"job_id"`
AttemptID string `json:"attempt_id"`
LeaseExpiresAt time.Time `json:"lease_expires_at"`
DeadlineAt time.Time `json:"deadline_at"`
ModelID string `json:"model_id"`
Request ChatRequest `json:"request"`
Verification JobVerification `json:"verification"`
}
type JobRejectedPayload ¶
type JobStartedPayload ¶
type JobVerification ¶
type MessageType ¶
type MessageType string
const ( TypeNodeHello MessageType = "node.hello" TypeNodeHeartbeat MessageType = "node.heartbeat" TypeNodeStateChanged MessageType = "node.state_changed" TypeModelDownloadProgress MessageType = "model.download_progress" TypeModelReady MessageType = "model.ready" TypeJobAccepted MessageType = "job.accepted" TypeJobRejected MessageType = "job.rejected" TypeJobStarted MessageType = "job.started" TypeJobCompleted MessageType = "job.completed" TypeJobFailed MessageType = "job.failed" TypeNodeSafetyEvent MessageType = "node.safety_event" TypeNodeLogEvent MessageType = "node.log_event" TypeSessionAccepted MessageType = "session.accepted" TypeNodeConfigUpdated MessageType = "node.config_updated" TypeModelAssign MessageType = "model.assign" TypeModelUnload MessageType = "model.unload" TypeJobOffer MessageType = "job.offer" TypeJobCancel MessageType = "job.cancel" TypeNodeDrain MessageType = "node.drain" TypeRuntimeUpdateAvailable MessageType = "runtime.update_available" )
type ModelAssignPayload ¶
type ModelDownloadProgressPayload ¶
type ModelDownloadProgressPayload struct {
NodeID string `json:"node_id"`
ModelID string `json:"model_id"`
ArtifactID string `json:"artifact_id"`
BytesDownloaded int64 `json:"bytes_downloaded"`
BytesTotal int64 `json:"bytes_total"`
Percent float64 `json:"percent"`
Timestamp time.Time `json:"timestamp"`
}
type ModelReadyPayload ¶
type ModelUnloadPayload ¶
type NodeDrainPayload ¶
type NodeHeartbeatPayload ¶
type NodeHeartbeatPayload struct {
NodeID string `json:"node_id"`
Sequence int64 `json:"sequence"`
State string `json:"state"`
ModelID string `json:"model_id,omitempty"`
RuntimeHash string `json:"runtime_hash,omitempty"`
ModelHash string `json:"model_hash,omitempty"`
GPU GPUStatus `json:"gpu"`
GPUVendor string `json:"gpu_vendor,omitempty"`
ActiveJobID *string `json:"active_job_id"`
ScheduleState string `json:"schedule_state,omitempty"`
ThermalState string `json:"thermal_state,omitempty"`
Paused bool `json:"paused,omitempty"`
Draining bool `json:"draining,omitempty"`
UptimeSeconds int64 `json:"uptime_seconds"`
Timestamp time.Time `json:"timestamp"`
}
type NodeHelloPayload ¶
type NodeLogEventPayload ¶
type NodeSafetyEventPayload ¶
type NodeSafetyEventPayload struct {
NodeID string `json:"node_id"`
EventCode string `json:"event_code"`
Severity string `json:"severity"`
Message string `json:"message"`
TemperatureC *int `json:"temperature_c,omitempty"`
PowerW *int `json:"power_w,omitempty"`
OccurredAt time.Time `json:"occurred_at"`
}
type NodeSignature ¶
type NodeStateChangedPayload ¶
type RuntimeUpdateAvailablePayload ¶
type RuntimeUpdateAvailablePayload struct {
RuntimeID string `json:"runtime_id"`
Version string `json:"version"`
ManifestURL string `json:"manifest_url"`
BinarySHA256 string `json:"binary_sha256"`
Required bool `json:"required"`
ReleaseNotesURL string `json:"release_notes_url,omitempty"`
AvailableAt time.Time `json:"available_at"`
}
type SessionAcceptedPayload ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is safe for concurrent use: the coordinator shares one validator across every node session goroutine.
func NewValidator ¶
func (*Validator) MarshalAndValidate ¶
Click to show internal directories.
Click to hide internal directories.