CoolFace
Modelpublic

Zlib2/bonsai-8b-colab-prebuilt

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes12downloads
Model Card

Bonsai-8B (GGUF) โ€“ Run in 30 Seconds ๐Ÿš€

โšก Quick Start

๐Ÿ”ง Setup (run once)

python
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

python
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