llama-index llms huggingface api integration
Project Links
Meta
Author: Your Name
Requires Python: <4.0,>=3.10
Classifiers
LlamaIndex Llms Integration: Huggingface API
Integration with Hugging Face's Inference API for generating text.
For more information on Hugging Face's Inference API, visit Hugging Face's Inference API documentation.
Installation
pip install llama-index-llms-huggingface-api
Usage
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
llm = HuggingFaceInferenceAPI(
model_name="openai-community/gpt2",
temperature=0.7,
max_tokens=100,
token="<your-token>", # Optional
provider="hf-inference", # Optional
)
response = llm.complete("Hello, how are you?")
0.7.0
Mar 12, 2026
0.6.2
Feb 02, 2026
0.6.1
Sep 08, 2025
0.6.0
Jul 30, 2025
0.5.0
May 30, 2025
0.4.3
May 08, 2025
0.4.2
May 01, 2025
0.4.1
Mar 01, 2025
0.4.0
Feb 28, 2025
0.3.1
Jan 06, 2025
0.3.0
Nov 18, 2024
0.2.0
Aug 22, 2024
0.1.0
Jun 14, 2024