cllama

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ModelPolicyModeClamp = "clamp"

Variables

This section is empty.

Functions

func GenerateContextDir

func GenerateContextDir(runtimeDir string, agents []AgentContextInput) error

GenerateContextDir writes per-agent context files under:

<runtimeDir>/context/<agent-id>/{AGENTS.md,CLAWDAPUS.md,metadata.json,feeds.json,service-auth/...}

func GenerateToken

func GenerateToken(agentID string) string

GenerateToken returns a bearer token in "<agent-id>:<48-hex-secret>" format.

func InjectCompiledModelPolicy added in v0.4.3

func InjectCompiledModelPolicy(meta map[string]any, models map[string]string) map[string]any

InjectCompiledModelPolicy clones meta and attaches a compiled model_policy block when the agent declares any MODEL refs.

func ProxyBaseURL added in v0.2.0

func ProxyBaseURL(proxyType string) string

ProxyBaseURL returns the API base URL for a proxy inside the compose network.

func ProxyHealthcheckBinary added in v0.2.0

func ProxyHealthcheckBinary(proxyType string) string

ProxyHealthcheckBinary returns the binary path used by compose healthchecks.

func ProxyImageRef added in v0.2.0

func ProxyImageRef(proxyType string) string

ProxyImageRef returns the default image reference for a proxy type. Passthrough uses the consolidated "ghcr.io/mostlydev/cllama:latest" image.

func ProxyServiceName added in v0.2.0

func ProxyServiceName(proxyType string) string

ProxyServiceName returns the compose service name for a proxy type. Passthrough is the canonical default and maps to "cllama".

func ProxyType added in v0.2.0

func ProxyType(proxyType string) string

ProxyType normalizes a proxy type token.

Types

type AgentContextInput

type AgentContextInput struct {
	AgentID     string
	AgentsMD    string
	ClawdapusMD string
	Metadata    map[string]interface{}
	Feeds       []FeedManifestEntry
	ServiceAuth []ServiceAuthEntry
}

type AllowedModel added in v0.4.3

type AllowedModel struct {
	Slot string `json:"slot"`
	Ref  string `json:"ref"`
}

type FeedManifestEntry added in v0.3.1

type FeedManifestEntry struct {
	Name   string `json:"name"`
	Source string `json:"source"`
	Path   string `json:"path"`
	TTL    int    `json:"ttl"`
	URL    string `json:"url,omitempty"`
	Auth   string `json:"auth,omitempty"` // bearer token for authenticated feeds (e.g. claw-api)
}

type ModelPolicy added in v0.4.3

type ModelPolicy struct {
	Mode    string         `json:"mode"`
	Allowed []AllowedModel `json:"allowed"`
}

func CompileModelPolicy added in v0.4.3

func CompileModelPolicy(models map[string]string) *ModelPolicy

CompileModelPolicy builds a deterministic per-agent model policy from resolved MODEL directives. Empty refs are ignored. When no valid refs remain, nil is returned and no policy should be emitted.

type ServiceAuthEntry added in v0.3.1

type ServiceAuthEntry struct {
	Service   string `json:"service"`
	AuthType  string `json:"auth_type"`
	Token     string `json:"token,omitempty"`
	Principal string `json:"principal,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL