Skip to main content

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
)

response = llm.complete("Hello, how are you?")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_llms_huggingface_api-0.2.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_llms_huggingface_api-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 37c866071e2ebd668e4714ccaf69811c7be3891e07546a513b0aaf78259112fb
MD5 7ece13b8374072ef0fd499f4d8dcfad9
BLAKE2b-256 126a5b6d40f1481496444b59228f5c9426601802b7f9826512f0bb0ee48adc44

See more details on using hashes here.

File details

Details for the file llama_index_llms_huggingface_api-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed12bcf6986becee1dc5f7644ff22aa96070de3b463add22c3b6ceabc2bd2f43
MD5 31c4d507a07b8b6dd2735ab59c9a4329
BLAKE2b-256 13e25cdc0134c26834e26e9769c21cfa75d3041dd8041deea01817768656df63

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page