llamacpp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package llamacpp provides a spec-faithful HTTP emulator of the llama.cpp OpenAI-compatible API server for use in tests.

Index

Constants

View Source
const DefaultChatNonStreamJSON = `` /* 299-byte string literal not displayed */
View Source
const DefaultChatStreamSSE = "data: {\"id\":\"gen-llamacpp-refbackend-stream\",\"object\":\"chat.completion.chunk\",\"created\":1715620000,\"model\":\"local-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"llamacpp-ok\"},\"finish_reason\":null}]}\n\n" +
	"data: [DONE]\n\n"
View Source
const DefaultModelsJSON = `` /* 161-byte string literal not displayed */

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(cfg Config) http.Handler

Types

type Config

type Config struct {
	AllowMissingBearer     bool
	OnAuthorizedCredential func(secret string)
	ForcedHTTPStatus       int
	ForcedRetryAfter       string
	ForcedErrorJSON        string
	OnRequestBody          func(body []byte)
	OnRequestHeaders       func(h http.Header)

	ChatNonStreamJSON string
	ChatStreamSSE     string
}

Jump to

Keyboard shortcuts

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