Documentation
¶
Index ¶
- Constants
- func LogMiddleware(next http.Handler) http.Handler
- func SetupLogging(buf *LogBuffer)
- type LogBuffer
- type ProviderPoolEvaluationLimits
- type ProviderPoolEvaluationPreview
- type ProviderPoolEvaluationRequest
- type Server
- func (s *Server) ActivateRouterProfile(ctx context.Context, poolID, profileID, actor, reason string) (routerprofile.Activation, error)
- func (s *Server) CancelProviderPoolEvaluationJob(ctx context.Context, poolID, jobID string) error
- func (s *Server) CreateProviderPoolEvaluationJob(ctx context.Context, request ProviderPoolEvaluationRequest) (routerprofile.EvaluationJob, error)
- func (s *Server) GetProviderPoolEvaluationJob(ctx context.Context, poolID, jobID string) (routerprofile.EvaluationJob, []routerprofile.EvaluationCell, error)
- func (s *Server) ListProviderPoolEvaluationJobs(ctx context.Context, poolID string, status routerprofile.JobStatus, ...) ([]routerprofile.EvaluationJob, error)
- func (s *Server) PreviewProviderPoolEvaluation(ctx context.Context, request ProviderPoolEvaluationRequest) (ProviderPoolEvaluationPreview, error)
- func (s *Server) RollbackRouterProfile(ctx context.Context, poolID, expectedCurrent, actor, reason string) (routerprofile.Activation, error)
- func (s *Server) Run(ctx context.Context) error
- func (s *Server) ValidateRouterProfile(ctx context.Context, poolID, profileID string) (routerprofile.Profile, error)
Constants ¶
const ( DefaultKeepAlive = 5 * time.Minute DesktopAPIProtocol = "2" )
Variables ¶
This section is empty.
Functions ¶
func LogMiddleware ¶
LogMiddleware logs HTTP requests to the standard logger with timing info.
func SetupLogging ¶
func SetupLogging(buf *LogBuffer)
SetupLogging redirects log output to the in-memory buffer and, by default, mirrors it to stderr and ~/.csghub-lite/logs/csghub-lite.log.
Types ¶
type LogBuffer ¶
type LogBuffer struct {
// contains filtered or unexported fields
}
LogBuffer is a thread-safe ring buffer for log lines, supporting SSE subscribers.
func NewLogBuffer ¶
func (*LogBuffer) Unsubscribe ¶
type ProviderPoolEvaluationLimits ¶ added in v0.9.57
type ProviderPoolEvaluationPreview ¶ added in v0.9.57
type ProviderPoolEvaluationPreview struct {
EvaluationMode string
EligibleSnapshotCount int
SelectedSnapshotCount int
DirectCandidateCalls int
JudgeCalls int
MaxJudgeCalls int
MaxTotalCalls int
JudgePromptTokens int64
MaxJudgeTokenExposure int64
MaxTokenExposure int64
KnownJudgeEstimatedCost float64
KnownEstimatedCost float64
Currency string
UnknownPriceMembers []routerprofile.Target
JudgePriceKnown bool
RequiresUnknownPricingConsent bool
Limits ProviderPoolEvaluationLimits
}
type ProviderPoolEvaluationRequest ¶ added in v0.9.57
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ActivateRouterProfile ¶ added in v0.9.57
func (s *Server) ActivateRouterProfile(ctx context.Context, poolID, profileID, actor, reason string) (routerprofile.Activation, error)
ActivateRouterProfile validates, activates, and publishes a profile while holding the runtime profile lock, so requests see either cache generation.
func (*Server) CancelProviderPoolEvaluationJob ¶ added in v0.9.57
func (*Server) CreateProviderPoolEvaluationJob ¶ added in v0.9.57
func (s *Server) CreateProviderPoolEvaluationJob(ctx context.Context, request ProviderPoolEvaluationRequest) (routerprofile.EvaluationJob, error)
func (*Server) GetProviderPoolEvaluationJob ¶ added in v0.9.57
func (s *Server) GetProviderPoolEvaluationJob(ctx context.Context, poolID, jobID string) (routerprofile.EvaluationJob, []routerprofile.EvaluationCell, error)
func (*Server) ListProviderPoolEvaluationJobs ¶ added in v0.9.57
func (s *Server) ListProviderPoolEvaluationJobs(ctx context.Context, poolID string, status routerprofile.JobStatus, options routerprofile.ListOptions) ([]routerprofile.EvaluationJob, error)
func (*Server) PreviewProviderPoolEvaluation ¶ added in v0.9.57
func (s *Server) PreviewProviderPoolEvaluation(ctx context.Context, request ProviderPoolEvaluationRequest) (ProviderPoolEvaluationPreview, error)
PreviewProviderPoolEvaluation resolves pricing from the model catalog at request time. It performs no inference and does not create a job.
func (*Server) RollbackRouterProfile ¶ added in v0.9.57
func (s *Server) RollbackRouterProfile(ctx context.Context, poolID, expectedCurrent, actor, reason string) (routerprofile.Activation, error)
RollbackRouterProfile rolls back in storage, validates the resulting active profile against current members, and atomically refreshes the runtime cache.
func (*Server) ValidateRouterProfile ¶ added in v0.9.57
func (s *Server) ValidateRouterProfile(ctx context.Context, poolID, profileID string) (routerprofile.Profile, error)
ValidateRouterProfile validates a stored profile against the current pool and the activation held-out gates. It performs no mutation.
Source Files
¶
- ai_app_shell_process_unix.go
- anthropic_ctx.go
- auth.go
- cloud_models.go
- correlation.go
- dataset_export_jobs.go
- handlers.go
- handlers_anthropic.go
- handlers_api_keys.go
- handlers_apps.go
- handlers_apps_csgclaw.go
- handlers_apps_desktop.go
- handlers_apps_lifecycle.go
- handlers_apps_open.go
- handlers_apps_provider.go
- handlers_apps_shell.go
- handlers_apps_xiaozhi.go
- handlers_audio.go
- handlers_chat_tools.go
- handlers_cloud.go
- handlers_conversations.go
- handlers_dataset.go
- handlers_dataset_download.go
- handlers_dataset_exports.go
- handlers_dataset_publish.go
- handlers_desktop_external.go
- handlers_image_jobs.go
- handlers_images.go
- handlers_local_models.go
- handlers_logs.go
- handlers_marketplace.go
- handlers_model_download.go
- handlers_model_upload.go
- handlers_model_upload_session.go
- handlers_models.go
- handlers_observability.go
- handlers_openai.go
- handlers_openai_embeddings.go
- handlers_provider_pool_router.go
- handlers_provider_pools.go
- handlers_provider_tags.go
- handlers_providers.go
- handlers_pull_jobs.go
- handlers_responses.go
- handlers_settings_directories.go
- handlers_system.go
- handlers_upgrade.go
- handlers_websearch.go
- local_model_id.go
- model_metadata.go
- model_providers.go
- observability.go
- pipeline_tags.go
- provider_pipeline_inference.go
- provider_pipeline_rules_gen.go
- provider_pool_curation.go
- provider_pool_evaluation.go
- provider_pool_inference.go
- provider_pool_router_profile.go
- provider_pool_semantic.go
- provider_routes.go
- routes.go
- server.go
- speculative.go
- static.go
- third_party_providers.go
- usage.go
- websearch_route_fast.go
- websearch_route_prompt.go