bridge.services.huggingface package#
Public Interface#
This section documents user-facing interface of the bridge.services.huggingface package (as defined in its __init__.py file).
Classes#
|
Hugging Face provider for chat-capable models using InferenceClient. |
Hugging Face integrations: model provider for accessing chat LLMs hosted on Hugging Face.
- class bridge.services.huggingface.HuggingFaceProvider(model='Qwen/Qwen3-8B', provider='featherless-ai')[source]#
Bases:
LLMProviderHugging Face provider for chat-capable models using InferenceClient. Supports models compatible with the chat.completions API.
- Parameters:
model (str) – The Hugging Face model identifier to use for chat generation. Default is “Qwen/Qwen3-8B” (https://huggingface.co/Qwen/Qwen2.5-7B).
provider (HF_Provider) – The inference provider to use. Default is “featherless-ai”.
- async generate(messages, **kwargs)[source]#
Generate a chat-based response from the model.
- Parameters:
messages (list[ChatMessage]) – A list of chat messages forming the conversation history.
**kwargs – Additional generation parameters such as max_new_tokens and temperature.
- Returns:
The generated chat message (response) from the model.
- Return type:
- Raises:
ValueError – If messages is empty.
RuntimeError – If the model response is missing required fields.
Exception – For any other errors during generation.
Submodules#
LLM provider wrapping huggingface_hub’s InferenceClient for chat-style text generation used by pipelines. |
Dependencies diagram#
Each architecture diagram below visualizes the internal dependency structure of the bridge.services.huggingface package.
It shows how modules and subpackages within the package depend on each other, based on direct Python imports.
Packages are shown as purple rectangles
Modules are shown as pink rectangles
Arrows (A → B) indicate that A directly imports B
Each subpackage’s diagram focuses only on its own internal structure, it does not include imports to or from higher-level packages (those appear in the parent package’s diagram).