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.0.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.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.6.0.tar.gz
Algorithm Hash digest
SHA256 48b0d55a2de58879f92f83facfae2e8cceb09c64a00fe8e7424eae4ab278d091
MD5 942c85063522470cd59051ed1aa6807b
BLAKE2b-256 1cdd52f1272d62068cd560a42aadfaa4e4f19d2c520f4d894326cd0cd9394e3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cecd3532aa3928eee9f214ca02bcdb86f2e7942d73bb011000d4257dd6644cf
MD5 ed3216a413870c07059b4fa9d2364cf3
BLAKE2b-256 f77d189d4e68805f5ffdcb26797a1402ce92463b2c4684bc2833ce07441218de

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