acon96/Home-Assistant-Requests
Viewer • Updated • 35.8k • 249 • 44
How to use premrajreddy/tinyllama-1.1b-home-llm with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="premrajreddy/tinyllama-1.1b-home-llm", filename="tinyllama-1.1B-merged-F16.gguf", )
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)How to use premrajreddy/tinyllama-1.1b-home-llm with llama.cpp:
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf premrajreddy/tinyllama-1.1b-home-llm:F16 # Run inference directly in the terminal: llama-cli -hf premrajreddy/tinyllama-1.1b-home-llm:F16
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf premrajreddy/tinyllama-1.1b-home-llm:F16 # Run inference directly in the terminal: llama-cli -hf premrajreddy/tinyllama-1.1b-home-llm:F16
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf premrajreddy/tinyllama-1.1b-home-llm:F16 # Run inference directly in the terminal: ./llama-cli -hf premrajreddy/tinyllama-1.1b-home-llm:F16
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf premrajreddy/tinyllama-1.1b-home-llm:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf premrajreddy/tinyllama-1.1b-home-llm:F16
docker model run hf.co/premrajreddy/tinyllama-1.1b-home-llm:F16
How to use premrajreddy/tinyllama-1.1b-home-llm with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "premrajreddy/tinyllama-1.1b-home-llm"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "premrajreddy/tinyllama-1.1b-home-llm",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/premrajreddy/tinyllama-1.1b-home-llm:F16
How to use premrajreddy/tinyllama-1.1b-home-llm with Ollama:
ollama run hf.co/premrajreddy/tinyllama-1.1b-home-llm:F16
How to use premrajreddy/tinyllama-1.1b-home-llm with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for premrajreddy/tinyllama-1.1b-home-llm to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for premrajreddy/tinyllama-1.1b-home-llm to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for premrajreddy/tinyllama-1.1b-home-llm to start chatting
How to use premrajreddy/tinyllama-1.1b-home-llm with Docker Model Runner:
docker model run hf.co/premrajreddy/tinyllama-1.1b-home-llm:F16
How to use premrajreddy/tinyllama-1.1b-home-llm with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull premrajreddy/tinyllama-1.1b-home-llm:F16
lemonade run user.tinyllama-1.1b-home-llm-F16
lemonade list
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0, trained with acon96/Home-Assistant-Requests.
It is designed to act as a voice-controlled smart home assistant that takes natural language instructions and outputs Home Assistant commands.
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("premrajreddy/tinyllama-1.1b-home-llm")
model = AutoModelForCausalLM.from_pretrained("premrajreddy/tinyllama-1.1b-home-llm")
query = "turn on the kitchen lights"
inputs = tokenizer(query, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=80)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Base model
TinyLlama/TinyLlama-1.1B-Chat-v1.0