Zlib2/bonsai-8b-colab-prebuilt
112
Bonsai-8B (GGUF) โ Run in 30 Seconds ๐
โก Quick Start
๐ง Setup (run once)
import os
import tarfile
print("๐ฆ Installing dependencies...")
!pip install -q huggingface_hub
from huggingface_hub import hf_hub_download
HF_REPO = "Zlib2/bonsai-8b-colab-prebuilt"
print("\n๐ฅ 1/3 Downloading pre-built llama.cpp (Fast)...")
llama_zip = hf_hub_download(repo_id=HF_REPO, filename="llama_cpp_prebuilt.tar.gz")
print("๐ฅ 2/3 Downloading Bonsai-8B.gguf model (Large file)...")
model_path = hf_hub_download(repo_id=HF_REPO, filename="Bonsai-8B.gguf")
print("๐ฆ 3/3 Extracting files...")
!mkdir -p /content/llama.cpp
with tarfile.open(llama_zip, "r:gz") as tar:
tar.extractall(path="/content/llama.cpp")
!chmod +x /content/llama.cpp/build/bin/llama-cli
print("\n๐ Setup complete!")๐ค Run Inference
USER_PROMPT = "Explain quantum computing in simple terms."
SYSTEM_PROMPT = "You are a helpful assistant"
!/content/llama.cpp/build/bin/llama-cli \
-m "{model_path}" \
--system-prompt "{SYSTEM_PROMPT}" \
-p "{USER_PROMPT}" \
-n 4096 \
--temp 0.5 \
--top-p 0.85 \
--top-k 20 \
-ngl 99