Documentation
¶
Overview ¶
Package huggingface exposes the HuggingFace Inference Router, which is OpenAI-compatible — chat completions hit /v1/chat/completions with the same request/response shape.
NewChat returns the provider-local Chat, backed by the shared OpenAI Chat Completions protocol and configured for the Hugging Face router. Callers receive tool calling and streaming without depending on OpenAI's concrete adapter type.
Index ¶
Constants ¶
View Source
const ( OpenAIRequestExtensionKey = "huggingface/openai_request" OpenAIResponseExtensionKey = "huggingface/openai_response" OpenAIStreamChunkExtensionKey = "huggingface/openai_stream_chunk" )
View Source
const ( // DefaultBaseURL targets the HuggingFace router which proxies to a // curated set of inference providers (together, fireworks, nebius, // sambanova, hf-inference, ...). The router exposes an // OpenAI-compatible /chat/completions endpoint. DefaultBaseURL = "https://router.huggingface.co/v1" )
View Source
const ModelGPTOSS120B = "openai/gpt-oss-120b"
View Source
const (
Provider = "HuggingFace"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶ added in v0.13.0
type Chat = openai.ChatCompletions
Chat implements the Hugging Face router's chat endpoint.
func NewChat ¶ added in v0.13.0
func NewChat(config ChatConfig) (*Chat, error)
Click to show internal directories.
Click to hide internal directories.