Instructions to use MebinThattil/tiny-llama-q4_0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use MebinThattil/tiny-llama-q4_0 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="MebinThattil/tiny-llama-q4_0", filename="tinyllama-1.1B-q4.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use MebinThattil/tiny-llama-q4_0 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MebinThattil/tiny-llama-q4_0 # Run inference directly in the terminal: llama-cli -hf MebinThattil/tiny-llama-q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MebinThattil/tiny-llama-q4_0 # Run inference directly in the terminal: llama-cli -hf MebinThattil/tiny-llama-q4_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 MebinThattil/tiny-llama-q4_0 # Run inference directly in the terminal: ./llama-cli -hf MebinThattil/tiny-llama-q4_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 MebinThattil/tiny-llama-q4_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf MebinThattil/tiny-llama-q4_0
Use Docker
docker model run hf.co/MebinThattil/tiny-llama-q4_0
- LM Studio
- Jan
- Ollama
How to use MebinThattil/tiny-llama-q4_0 with Ollama:
ollama run hf.co/MebinThattil/tiny-llama-q4_0
- Unsloth Studio new
How to use MebinThattil/tiny-llama-q4_0 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 MebinThattil/tiny-llama-q4_0 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 MebinThattil/tiny-llama-q4_0 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for MebinThattil/tiny-llama-q4_0 to start chatting
- Docker Model Runner
How to use MebinThattil/tiny-llama-q4_0 with Docker Model Runner:
docker model run hf.co/MebinThattil/tiny-llama-q4_0
- Lemonade
How to use MebinThattil/tiny-llama-q4_0 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MebinThattil/tiny-llama-q4_0
Run and chat with the model
lemonade run user.tiny-llama-q4_0-{{QUANT_TAG}}List all available models
lemonade list
| import sys | |
| import ctypes | |
| import logging | |
| import llama_cpp | |
| # enum ggml_log_level { | |
| # GGML_LOG_LEVEL_NONE = 0, | |
| # GGML_LOG_LEVEL_INFO = 1, | |
| # GGML_LOG_LEVEL_WARN = 2, | |
| # GGML_LOG_LEVEL_ERROR = 3, | |
| # GGML_LOG_LEVEL_DEBUG = 4, | |
| # GGML_LOG_LEVEL_CONT = 5, // continue previous log | |
| # }; | |
| GGML_LOG_LEVEL_TO_LOGGING_LEVEL = { | |
| 0: logging.CRITICAL, | |
| 1: logging.INFO, | |
| 2: logging.WARNING, | |
| 3: logging.ERROR, | |
| 4: logging.DEBUG, | |
| 5: logging.DEBUG, | |
| } | |
| logger = logging.getLogger("llama-cpp-python") | |
| _last_log_level = GGML_LOG_LEVEL_TO_LOGGING_LEVEL[0] | |
| # typedef void (*ggml_log_callback)(enum ggml_log_level level, const char * text, void * user_data); | |
| def llama_log_callback( | |
| level: int, | |
| text: bytes, | |
| user_data: ctypes.c_void_p, | |
| ): | |
| # TODO: Correctly implement continue previous log | |
| global _last_log_level | |
| log_level = GGML_LOG_LEVEL_TO_LOGGING_LEVEL[level] if level != 5 else _last_log_level | |
| if logger.level <= GGML_LOG_LEVEL_TO_LOGGING_LEVEL[level]: | |
| print(text.decode("utf-8"), end="", flush=True, file=sys.stderr) | |
| _last_log_level = log_level | |
| llama_cpp.llama_log_set(llama_log_callback, ctypes.c_void_p(0)) | |
| def set_verbose(verbose: bool): | |
| logger.setLevel(logging.DEBUG if verbose else logging.ERROR) | |