llmd

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 9 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 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