Instructions to use ThoughtfulThings/phi-2-light-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ThoughtfulThings/phi-2-light-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ThoughtfulThings/phi-2-light-gguf", filename="phi-2-light-Q8_0.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ThoughtfulThings/phi-2-light-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ThoughtfulThings/phi-2-light-gguf:Q8_0 # Run inference directly in the terminal: llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ThoughtfulThings/phi-2-light-gguf:Q8_0 # Run inference directly in the terminal: llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0
Use pre-built binary
# 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 ThoughtfulThings/phi-2-light-gguf:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0
Build from source code
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 ThoughtfulThings/phi-2-light-gguf:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0
Use Docker
docker model run hf.co/ThoughtfulThings/phi-2-light-gguf:Q8_0
- LM Studio
- Jan
- Ollama
How to use ThoughtfulThings/phi-2-light-gguf with Ollama:
ollama run hf.co/ThoughtfulThings/phi-2-light-gguf:Q8_0
- Unsloth Studio new
How to use ThoughtfulThings/phi-2-light-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
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 ThoughtfulThings/phi-2-light-gguf to start chatting
Install Unsloth Studio (Windows)
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 ThoughtfulThings/phi-2-light-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ThoughtfulThings/phi-2-light-gguf to start chatting
- Docker Model Runner
How to use ThoughtfulThings/phi-2-light-gguf with Docker Model Runner:
docker model run hf.co/ThoughtfulThings/phi-2-light-gguf:Q8_0
- Lemonade
How to use ThoughtfulThings/phi-2-light-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ThoughtfulThings/phi-2-light-gguf:Q8_0
Run and chat with the model
lemonade run user.phi-2-light-gguf-Q8_0
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf ThoughtfulThings/phi-2-light-gguf:Q8_0# Run inference directly in the terminal:
llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0Use pre-built binary
# 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 ThoughtfulThings/phi-2-light-gguf:Q8_0# Run inference directly in the terminal:
./llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0Build from source code
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 ThoughtfulThings/phi-2-light-gguf:Q8_0# Run inference directly in the terminal:
./build/bin/llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0Use Docker
docker model run hf.co/ThoughtfulThings/phi-2-light-gguf:Q8_0YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Thoughtful Lamp
These are the weights in gguf format for the "thoughtful lamp" from our paper Teaching Things To Think: Bootstrapping Local Reasoning for Smart(er) Devices.
The base model has been fine-tuned to take "action" and "explanation" oriented commands that a user might give to a smart lamp and generate either JSON actions or natural language explanations in response.
Please refer to the GitHub repo for more information.
Prompt Structure
The models are fine-tuned to accept prompts in this format:
Action
User: {command}
[SENSORS] {sensor json} [/SENSORS]
Output: [SETTINGS]
Introspection
User: {command}
[SENSORS] {sensor json} [/SENSORS]
[SETTINGS] {settings json} [/SETTINGS]
Output: [EXPLANATION]
Citation
If our work is helpful, please cite us:
@inproceedings{king2025teaching,
title={Teaching Things To Think: Bootstrapping Local Reasoning for Smart (er) Devices},
author={King, Evan and Yu, Haoxiang and Vartak, Sahil and Jacob, Jenna and Lee, Sangsu and Julien, Christine},
booktitle={2025 IEEE International Conference on Pervasive Computing and Communications (PerCom)},
pages={78--88},
year={2025},
organization={IEEE}
}
Contact
Contact Evan King with questions, or open an issue on the repository.
- Downloads last month
- 9
8-bit
16-bit
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf ThoughtfulThings/phi-2-light-gguf:Q8_0# Run inference directly in the terminal: llama-cli -hf ThoughtfulThings/phi-2-light-gguf:Q8_0