Skip to main content

llama-index llms huggingface api integration

Project description

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?")

Project details


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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.6.1.tar.gz
Algorithm Hash digest
SHA256 e29bcdde6c1ed845c43e8c60598033e7fda227c20fbedf7f549ab8d690ee54b5
MD5 57256f913639284429014c269089ae01
BLAKE2b-256 997a161d429ac0a3f4a599035351ff342556b896f072bd431708e394f4f2870f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4e31682b53709550ad5331c00f49774e054cfc240264416cd5a7c5d211def93
MD5 fef804394e5c24af92f782f2cd98d2b3
BLAKE2b-256 d2c7ee54945dd8346daf339744ac5ad1e2643ba33ad1242c9d7d19bb9ea139da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page