Llama-3.1-8B-Instruct fine-tuned with LoRA on a solar energy FAQ dataset,
quantized to Q4_K_M GGUF — runs on any platform, any OS, no CUDA required.
Format
GGUF Q4_K_M (safe — no pickle, no .bin)
Size
4.6 GB (original: 16 GB float16)
Platforms
Mac / Windows / Linux / CPU / GPU
Tools
llama-cpp-python · Ollama · LM Studio · Jan · GPT4All
Install & Run
Option 1 — Python API (llama-cpp-python)
Step 1 — Install llama-cpp-python (choose one):
bash
1# Mac Apple Silicon — Metal GPU acceleration (FAST):2CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python
34# NVIDIA GPU Linux/Windows — CUDA 12.4 (FAST):5pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124
67# CPU only — any platform, no GPU needed (slower ~5 tok/s):8pip install llama-cpp-python
Step 2 — Run:
python
1from llama_cpp import Llama
23# Auto-downloads the GGUF from HF on first run (~4.6 GB)4llm = Llama.from_pretrained(5 repo_id="ankur1423/solar-faq-gguf",6 filename="*.gguf",7 n_ctx=2048,# context window8 n_gpu_layers=-1,# -1 = all layers on GPU; set 0 for CPU-only9 verbose=False,10)1112# Single question13response = llm.create_chat_completion(14 messages=[15{"role":"system","content":"You are a knowledgeable assistant for a solar energy company. Answer questions accurately about solar products, manufacturing, and company operations."},16{"role":"user","content":"What is a BOM?"},17],18 max_tokens=512,19 temperature=0.1,20 top_p=0.9,21)22print(response["choices"][0]["message"]["content"])
Multi-turn conversation:
python
1from llama_cpp import Llama
23SYSTEM ="You are a knowledgeable assistant for a solar energy company."45llm = Llama.from_pretrained(6 repo_id="ankur1423/solar-faq-gguf",7 filename="*.gguf",8 n_ctx=4096,9 n_gpu_layers=-1,10 verbose=False,11)1213history =[{"role":"system","content": SYSTEM}]1415whileTrue:16 user =input("You: ").strip()17ifnot user or user.lower()in{"exit","quit"}:18break19 history.append({"role":"user","content": user})20 resp = llm.create_chat_completion(history, max_tokens=512, temperature=0.1)21 answer = resp["choices"][0]["message"]["content"].strip()22print(f"Assistant: {answer}\n")23 history.append({"role":"assistant","content": answer})
Option 2 — Ollama (no Python, no code)
bash
1# Install Ollama: https://ollama.com2ollama run hf.co/ankur1423/solar-faq-gguf
1# macOS (homebrew):2brew install llama.cpp
34# Linux:5sudoaptinstall llama.cpp # Ubuntu 24.04+67# Then download GGUF and run:8llama-cli \9 -m solar-faq-Q4_K_M.gguf \10 --system-prompt "You are a knowledgeable assistant for a solar energy company."\11 -i --color -c 2048
Platform Support Matrix
Platform
Backend
RAM needed
Speed
Mac M1/M2/M3/M4
Metal GPU
6 GB
Fast
NVIDIA GPU (Linux/Windows)
CUDA
6 GB VRAM
Fast
CPU — Mac / Windows / Linux
llama.cpp CPU
6 GB RAM
~5 tok/s
Google Colab (free tier)
CPU or T4 GPU
6 GB
OK
Ollama (any OS)
auto-detect GPU/CPU
6 GB
Fast / OK
LM Studio / Jan / GPT4All
auto-detect
6 GB
Fast / OK
Minimum: 6 GB RAM/VRAM. Works on most modern laptops with no GPU.
Generation Parameters (recommended)
Parameter
Value
Notes
temperature
0.1
Low → factual, consistent answers
top_p
0.9
Nucleus sampling
max_tokens
256–512
FAQ answers are concise
n_ctx
2048
Context window (increase to 4096 for long conversations)
For creative/varied responses, raise temperature to 0.5–0.7.
Prompt Format (Llama-3 chat template)
This model uses the Llama-3 chat template. The prompt format is:
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a knowledgeable assistant for a solar energy company.<|eot_id|>
<|start_header_id|>user<|end_header_id|>
What is a BOM?<|eot_id|>
<|start_header_id|>assistant<|end_header_id|>
llama-cpp-python's create_chat_completion() handles this automatically.
Training Details
Base model
meta-llama/Meta-Llama-3.1-8B-Instruct
Fine-tuning method
LoRA (rank 8, 8 layers)
Dataset
~62 solar energy FAQ Q&A pairs
Training iterations
300
Learning rate
1e-4 (cosine decay → 1e-5)
Batch size
2
Max sequence length
1024 tokens
Framework
MLX-LM 0.31+ on Apple Silicon
Quantization
GGUF Q4_K_M via llama.cpp
Size reduction
16 GB float16 → 4.6 GB (−71%)
Training hardware
MacBook M4 16 GB unified memory
Training time
~20 minutes
What is GGUF Q4_K_M?
GGUF (GPT-Generated Unified Format) is a safe, portable model format used by llama.cpp.
Q4_K_M = 4-bit quantization, K-quant method, Medium size/quality tradeoff:
Most weights stored in 4 bits (vs 16 bits in float16)
Quality loss: minimal (~0.1–0.5% perplexity increase vs float16)
Speed: faster than float16 on CPU due to smaller memory bandwidth
No pickle tensors, no arbitrary code — HF security scanner marks this as safe.
Limitations
Domain-specific (solar FAQ) — best for solar energy questions; falls back to base Llama-3 behavior outside training domain
English only
Small dataset (~62 pairs) — may not generalize to all solar topics
Fine-tuned on Q4_K_M base, so further quantization artifacts possible
License
This model is derived from Meta Llama 3.1, which is licensed under the
Meta Llama 3 Community License.
Use is subject to Meta's acceptable use policy.