llmd

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package llmd provides integration with the llm-d Router's OpenAI-compatible API.

Index

Constants

This section is empty.

Variables

View Source
var Registration = providers.Registration{
	Type:                        "llmd",
	New:                         New,
	PassthroughSemanticEnricher: passthroughSemanticEnricher,
	Discovery: providers.DiscoveryConfig{
		RequireBaseURL:  true,
		AllowAPIKeyless: true,
	},
}

Registration provides factory registration for the llm-d provider. An llm-d deployment has no universal endpoint, so base_url is required. Router authentication is optional and depends on the Gateway in front of llm-d.

Functions

func New

New creates an llm-d provider.

Types

type ControlConfig

type ControlConfig struct {
	InferenceObjective   string
	FairnessFromUserPath bool
}

ControlConfig contains trusted llm-d request-classification settings.

type Provider

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

Provider implements the OpenAI-compatible inference subset understood by llm-d's openai-parser. It intentionally does not advertise native files, batches, audio, or Responses lifecycle interfaces.

func (*Provider) ChatCompletion

func (p *Provider) ChatCompletion(ctx context.Context, req *core.ChatRequest) (*core.ChatResponse, error)

ChatCompletion sends a chat completion request to llm-d.

func (*Provider) Embeddings

Embeddings sends an embeddings request to llm-d.

func (*Provider) ListModels

func (p *Provider) ListModels(ctx context.Context) (*core.ModelsResponse, error)

ListModels asks the llm-d route for its OpenAI-compatible model inventory. Operators should configure providers.<name>.models when their HTTPRoute does not forward GET /v1/models to a model server.

func (*Provider) Passthrough

Passthrough routes an opaque request through llm-d after removing all client-supplied credentials and llm-d control headers.

func (*Provider) Responses

Responses sends a Responses API request to llm-d.

func (*Provider) SetBaseURL

func (p *Provider) SetBaseURL(baseURL string)

SetBaseURL changes the llm-d Router endpoint.

func (*Provider) StreamChatCompletion

func (p *Provider) StreamChatCompletion(ctx context.Context, req *core.ChatRequest) (io.ReadCloser, error)

StreamChatCompletion streams a chat completion request through llm-d.

func (*Provider) StreamResponses

func (p *Provider) StreamResponses(ctx context.Context, req *core.ResponsesRequest) (io.ReadCloser, error)

StreamResponses streams a Responses API request through llm-d.

Jump to

Keyboard shortcuts

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