Instructions to use QuantFactory/llama3-s-instruct-v0.2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/llama3-s-instruct-v0.2-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
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 QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
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 QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use QuantFactory/llama3-s-instruct-v0.2-GGUF with Ollama:
ollama run hf.co/QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
- Unsloth Studio
How to use QuantFactory/llama3-s-instruct-v0.2-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 QuantFactory/llama3-s-instruct-v0.2-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 QuantFactory/llama3-s-instruct-v0.2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/llama3-s-instruct-v0.2-GGUF to start chatting
- Pi
How to use QuantFactory/llama3-s-instruct-v0.2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use QuantFactory/llama3-s-instruct-v0.2-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use QuantFactory/llama3-s-instruct-v0.2-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/llama3-s-instruct-v0.2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.llama3-s-instruct-v0.2-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use QuantFactory/llama3-s-instruct-v0.2-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default QuantFactory/llama3-s-instruct-v0.2-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Configure Hermes
# Install Hermes:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
hermes setup# Point Hermes at the local server:
hermes config set model.provider custom
hermes config set model.base_url http://127.0.0.1:8080/v1
hermes config set model.default QuantFactory/llama3-s-instruct-v0.2-GGUF:Run Hermes
hermesQuantFactory/llama3-s-instruct-v0.2-GGUF
This is quantized version of homebrewltd/llama3-s-instruct-v0.2 created using llama.cpp
Original Model Card
Model Details
We have developed and released the family llama3s. This family is natively understanding audio and text input.
We expand the Semantic tokens experiment with WhisperVQ as a tokenizer for audio files from homebrewltd/llama3.1-s-base-v0.2 with nearly 1B tokens from Instruction Speech WhisperVQ v2 dataset.
Model developers Homebrew Research.
Input Text and sound.
Output Text.
Model Architecture Llama-3.
Language(s): English.
Intended Use
Intended Use Cases This family is primarily intended for research applications. This version aims to further improve the LLM on sound understanding capabilities.
Out-of-scope The use of llama3-s in any manner that violates applicable laws or regulations is strictly prohibited.
How to Get Started with the Model
Try this model using Google Colab Notebook.
First, we need to convert the audio file to sound tokens
device = "cuda" if torch.cuda.is_available() else "cpu"
if not os.path.exists("whisper-vq-stoks-medium-en+pl-fixed.model"):
hf_hub_download(
repo_id="jan-hq/WhisperVQ",
filename="whisper-vq-stoks-medium-en+pl-fixed.model",
local_dir=".",
)
vq_model = RQBottleneckTransformer.load_model(
"whisper-vq-stoks-medium-en+pl-fixed.model"
).to(device)
def audio_to_sound_tokens(audio_path, target_bandwidth=1.5, device=device):
vq_model.ensure_whisper(device)
wav, sr = torchaudio.load(audio_path)
if sr != 16000:
wav = torchaudio.functional.resample(wav, sr, 16000)
with torch.no_grad():
codes = vq_model.encode_audio(wav.to(device))
codes = codes[0].cpu().tolist()
result = ''.join(f'<|sound_{num:04d}|>' for num in codes)
return f'<|sound_start|>{result}<|sound_end|>'
def audio_to_sound_tokens_transcript(audio_path, target_bandwidth=1.5, device=device):
vq_model.ensure_whisper(device)
wav, sr = torchaudio.load(audio_path)
if sr != 16000:
wav = torchaudio.functional.resample(wav, sr, 16000)
with torch.no_grad():
codes = vq_model.encode_audio(wav.to(device))
codes = codes[0].cpu().tolist()
result = ''.join(f'<|sound_{num:04d}|>' for num in codes)
return f'<|reserved_special_token_69|><|sound_start|>{result}<|sound_end|>'
Then, we can inference the model the same as any other LLM.
def setup_pipeline(model_path, use_4bit=False, use_8bit=False):
tokenizer = AutoTokenizer.from_pretrained(model_path)
model_kwargs = {"device_map": "auto"}
if use_4bit:
model_kwargs["quantization_config"] = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
)
elif use_8bit:
model_kwargs["quantization_config"] = BitsAndBytesConfig(
load_in_8bit=True,
bnb_8bit_compute_dtype=torch.bfloat16,
bnb_8bit_use_double_quant=True,
)
else:
model_kwargs["torch_dtype"] = torch.bfloat16
model = AutoModelForCausalLM.from_pretrained(model_path, **model_kwargs)
return pipeline("text-generation", model=model, tokenizer=tokenizer)
def generate_text(pipe, messages, max_new_tokens=64, temperature=0.0, do_sample=False):
generation_args = {
"max_new_tokens": max_new_tokens,
"return_full_text": False,
"temperature": temperature,
"do_sample": do_sample,
}
output = pipe(messages, **generation_args)
return output[0]['generated_text']
# Usage
llm_path = "homebrewltd/llama3.1-s-instruct-v0.2"
pipe = setup_pipeline(llm_path, use_8bit=True)
Training process
Training Metrics Image: Below is a snapshot of the training loss curve visualized.
Hardware
GPU Configuration: Cluster of 8x NVIDIA H100-SXM-80GB. GPU Usage:
- Continual Training: 6 hours.
Training Arguments
We utilize torchtune library for the latest FSDP2 training code implementation.
| Parameter | Continual Training |
|---|---|
| Epoch | 1 |
| Global batch size | 128 |
| Learning Rate | 0.5e-4 |
| Learning Scheduler | Cosine with warmup |
| Optimizer | Adam torch fused |
| Warmup Ratio | 0.01 |
| Weight Decay | 0.005 |
| Max Sequence Length | 512 |
Examples
- Good example:
Click to toggle Example 1
Click to toggle Example 2
- Misunderstanding example:
Click to toggle Example 3
- Off-tracked example:
Click to toggle Example 4
Citation Information
BibTeX:
@article{Llama3-S: Sound Instruction Language Model 2024,
title={Llama3-S},
author={Homebrew Research},
year=2024,
month=August},
url={https://huggingface.co/homebrewltd/llama3.1-s-2024-08-20}
Acknowledgement
- Downloads last month
- 216
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit

Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp# Start a local OpenAI-compatible server: llama serve -hf QuantFactory/llama3-s-instruct-v0.2-GGUF: