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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.5.0.tar.gz
Algorithm Hash digest
SHA256 87826a7ebc6946606f0c80007febd89688bd602622e2dbace452e0cde39a88bf
MD5 4b609f8a3335fb43b0389fbfb2295d15
BLAKE2b-256 210cccf96de51b842fe1a6d5ccb666b54d78fe14ebb97f08dd82ff969c6b6a62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3ec0452c61be163fb934c3f507906717989dfa40d81a0b9489f3348e96b0979
MD5 b6cf90f01c85ebc01498cb7acad7f247
BLAKE2b-256 791dbe41914d77910f01a8608dadd6b8902548229e7bf7fd564f5f2fdf1c1f15

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