Current collected state Current
Observed since 21 Oct, 11:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
HuggingFace Commercial Model Free API
A lightweight Python interface for AI model interactions through Hugging Face's infrastructure.
pip install ailite
serve()Launch your own API server:
from ailite import serve
# Start server on http://0.0.0.0:11435
serve()
ai()The simplest way to get started:
from ailite import ai
response = ai("Explain quantum computing")
print(response)
ai()from ailite import ai
response = ai(
"Explain quantum computing",
model="nvidia/Llama-3.1-Nemotron-70B-Instruct-HF",
conversation=False
)
ai()from ailite import ai
# With streaming
for chunk in ai(
"Write a story about space",
stream=True
):
print(chunk, end="")
HUGPIClientFor more control over interactions:
from ailite import HUGPIClient
client = HUGPIClient(
api_key="your_email@gmail.com_your_password",
model="nvidia/Llama-3.1-Nemotron-70B-Instruct-HF",
system_prompt="You are a helpful assistant..."
)
# Generate text
response = client.messages.create(
prompt="What is the theory of relativity?",
conversation=True
)
print(response.content[0]["text"])
# Chat conversation
messages = [
{"role": "user", "content": "Hi, how are you?"},
{"role": "assistant", "content": "I'm doing well, how can I help?"},
{"role": "user", "content": "Tell me about AI"}
]
response = client.messages.create(messages=messages)
HUGPiLLMFor direct model interactions:
from ailite import HUGPiLLM
llm = HUGPiLLM(
hf_email="your_email@gmail.com",
hf_password="your_password",
default_llm=3, # Model index
system_prompt="Custom system instructions here"
)
response = llm.generate("Explain machine learning")
fastapi>=0.68.0
pydantic>=1.8.0
uvicorn>=0.15.0
requests>=2.26.0
MIT License - see LICENSE file for details.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.1 | 19 Dec 2024 | 8 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1bd2948d6b34ad7c5560f2d228c5c08acf3baada88b6eab33979055436bee156