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.4.3.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.4.3.tar.gz
Algorithm Hash digest
SHA256 76675150f6b0ce2dc43d41217e2c4f2ade34e2b9203128b37f88f43dc62fc745
MD5 db693156fb40eaf8e39170808ea0d67a
BLAKE2b-256 ffd4c4dc326930de97de6c6a77d2ac540529bd34cefc5b9c5d96a36b15e826d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 66b50bea40dac11ee3129d47c82f52f6f568bc8ca87e933b7a87af74b4d6c106
MD5 10a8acae485807b4574d4be9d8fe9a68
BLAKE2b-256 bf9cda5a3d274ea186d6e57c722d726ebbe4d30d793fbdbe9f0bfc6c31d9c076

See more details on using hashes here.

Supported by

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