virtualmodel

package
v0.260514.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MPL-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package virtualmodel exposes management endpoints for the in-process virtual-model providers. The providers themselves are persisted in the shared ProviderStore (Source=builtin); this module only surfaces the registry contents so the frontend can render the Credentials sub-tab and any future configuration UI without re-implementing registry traversal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(router *swagger.RouteGroup, authMiddleware gin.HandlerFunc, handler *Handler)

RegisterRoutes registers virtual-model management routes under the given /api/v1 group. Auth middleware is attached per-route via WithMiddleware so this registration does not mutate the parent group's middleware chain — other modules sharing /api/v1 are unaffected by registration order.

Types

type AvailableModelEntry

type AvailableModelEntry struct {
	ID       string `json:"id" example:"vm-claude-haiku"`
	Protocol string `json:"protocol" example:"anthropic"` // "anthropic" or "openai"
}

AvailableModelEntry describes a single virtual model registered in the in-process registries. It is independent of the OpenAI Model wire shape so the frontend can render protocol-specific badges without parsing IDs.

type AvailableModelsResponse

type AvailableModelsResponse struct {
	Success bool                  `json:"success" example:"true"`
	Data    []AvailableModelEntry `json:"data"`
}

AvailableModelsResponse is the response body of GET /vmodel/available-models.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves the virtual-model management endpoints.

func NewHandler

func NewHandler(service *virtualserver.Service) *Handler

NewHandler returns a Handler backed by the given vmodel service.

func (*Handler) ListAvailableModels

func (h *Handler) ListAvailableModels(c *gin.Context)

ListAvailableModels returns the union of models registered across the anthropic and openai protocol registries, tagged by protocol. The frontend uses this to populate the Credentials > Virtual Models sub-tab.

Jump to

Keyboard shortcuts

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