Documentation
¶
Index ¶
- Constants
- func DecodePublicKey(encoded string) (ed25519.PublicKey, error)
- func DefaultRuntimePublicKey() (ed25519.PublicKey, error)
- type ApprovedArgs
- type ChatMessage
- type CompletionRequest
- type CompletionResponse
- type CompletionUsage
- type InstalledRuntime
- type LaunchConfig
- type Manager
- type ManifestSignature
- type ReleaseManifest
- type RunningRuntime
- type RuntimeArtifact
- type SupportArtifact
Constants ¶
View Source
const DefaultRuntimePublicKeyBase64 = "/Bgu4fQntQGB6q3j18Z+du1L1/yOzU2/wNmSAQWVCMo="
Variables ¶
This section is empty.
Functions ¶
func DefaultRuntimePublicKey ¶
Types ¶
type ApprovedArgs ¶
type ChatMessage ¶
type CompletionRequest ¶
type CompletionRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
Temperature float64 `json:"temperature"`
MaxTokens int `json:"max_tokens"`
Stream bool `json:"stream"`
}
type CompletionResponse ¶
type CompletionResponse struct {
Choices []struct {
Message ChatMessage `json:"message"`
FinishReason string `json:"finish_reason"`
} `json:"choices"`
Usage CompletionUsage `json:"usage"`
}
func ChatCompletion ¶
func ChatCompletion(ctx context.Context, baseURL string, request CompletionRequest) (CompletionResponse, error)
type CompletionUsage ¶
type InstalledRuntime ¶
type InstalledRuntime struct {
Engine string `json:"engine"`
Version string `json:"version"`
BuildID string `json:"build_id"`
PlatformKey string `json:"platform_key"`
Path string `json:"path"`
ExecutablePath string `json:"executable_path"`
SHA256 string `json:"sha256"`
InstalledAt string `json:"installed_at"`
}
type LaunchConfig ¶
type Manager ¶
type Manager struct {
Root string
PublicKey ed25519.PublicKey
PlatformKey string
HTTPClient *http.Client
}
func (Manager) Ensure ¶
func (m Manager) Ensure(ctx context.Context, manifest ReleaseManifest) (InstalledRuntime, error)
func (Manager) Rollback ¶
func (m Manager) Rollback() (InstalledRuntime, error)
type ManifestSignature ¶
type ReleaseManifest ¶
type ReleaseManifest struct {
SchemaVersion int `json:"schema_version"`
Engine string `json:"engine"`
Version string `json:"version"`
BuildID string `json:"build_id"`
Artifacts map[string]RuntimeArtifact `json:"artifacts"`
Signature ManifestSignature `json:"signature"`
}
func LoadReleaseManifest ¶
func LoadReleaseManifest(path string) (ReleaseManifest, error)
func (ReleaseManifest) UnsignedBytes ¶
func (m ReleaseManifest) UnsignedBytes() ([]byte, error)
func (ReleaseManifest) VerifySignature ¶
func (m ReleaseManifest) VerifySignature(publicKey ed25519.PublicKey) error
type RunningRuntime ¶
func StartLlamaServer ¶
func StartLlamaServer(ctx context.Context, cfg LaunchConfig) (*RunningRuntime, error)
type RuntimeArtifact ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.