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.3.1.tar.gz (4.4 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.3.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.3.1.tar.gz
Algorithm Hash digest
SHA256 6531c8fe5405574ae997f5066085a8830cb60299cb5b93a8cf6e84f7d3e1c9fc
MD5 e7435274111896742e564d0594019373
BLAKE2b-256 35333edf8d33eb2a72f254d4aee81ec55c296245085faef1dcb37e6c2673ea2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6528900a4d59d594e489f58f34c3356b447b4d4ad58820d192ab5b9e951d5398
MD5 34d4787deb30e5a7248b841674bcdb06
BLAKE2b-256 0549c826ace3fd2241ce5ab7f5ee22c420bc948915410ecaf6013644460d19c8

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

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

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