These files were quantised using hardware kindly provided by
Massed Compute
.
WARNING: This README may contain inaccuracies. It was generated automatically by forking
TheBloke/rocket-3B-GGUF
and piping the README through sed. Errors should be reported to jartine, and do not reflect TheBloke. You can also support his work on
Patreon
.
About llamafile
llamafile is a new format introduced by Mozilla Ocho on Nov 20th 2023. It uses Cosmopolitan Libc to turn LLM weights into runnable llama.cpp binaries that run on the stock installs of six OSes for both ARM64 and AMD64.
Here is an incomplete list of clients and libraries that are known to support llamafile:
llama.cpp
. The source project for llamafile. Offers a CLI and a server option.
text-generation-webui
, the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.
KoboldCpp
, a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.
LM Studio
, an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration.
LoLLMS Web UI
, a great web UI with many interesting and unique features, including a full model library for easy model selection.
Faraday.dev
, an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.
ctransformers
, a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
llama-cpp-python
, a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
candle
, a Rust ML framework with a focus on performance, including GPU support, and ease of use.
These quantised llamafilev2 files are compatible with llama.cpp from August 27th onwards, as of commit
d0cee0d
They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
Explanation of quantisation methods
Click to see details
The new methods available are:
GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
Refer to the Provided Files table below to see what files use which methods, and how.
very large, extremely low quality loss - not recommended
Note
: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
How to download llamafile files
Note for manual downloaders:
You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
LM Studio
LoLLMS Web UI
Faraday.dev
In
text-generation-webui
Under Download Model, you can enter the model repo: jartine/rocket-3B-llamafile and below it, a specific filename to download, such as: rocket-3b.Q4_K_M.llamafile.
Then click Download.
On the command line, including multiple files at once
I recommend using the
huggingface-hub
Python library:
pip3 install huggingface-hub
Then you can download any individual model file to the current directory, at high speed, with a command like this:
Change
-ngl 32
to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
Change
-c 2048
to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the llamafile file and set by llama.cpp automatically.
If you want to have a chat-style conversation, replace the
-p <PROMPT>
argument with
-i -ins
How to load this model in Python code, using ctransformers
First install the package
Run one of the following commands, according to your system:
# Base ctransformers with no GPU acceleration
pip install ctransformers
# Or with CUDA GPU acceleration
pip install ctransformers[cuda]
# Or with AMD ROCm GPU acceleration (Linux only)
CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
# Or with Metal GPU acceleration for macOS systems only
CT_METAL=1 pip install ctransformers --no-binary ctransformers
Simple ctransformers example code
from ctransformers import AutoModelForCausalLM
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
llm = AutoModelForCausalLM.from_pretrained("jartine/rocket-3B-llamafile", model_file="rocket-3b.Q4_K_M.llamafile", model_type="stablelm", gpu_layers=50)
print(llm("AI is going to"))
How to use with LangChain
Here are guides on using llama-cpp-python and ctransformers with LangChain:
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
And thank you again to mozilla for their generous grant.
Original model card: pansophic's Rocket 3B
Rocket-3B 🦝
Rocket
🦝 is a 3 billion large language model that was trained on a mix of publicly available datasets using
Direct Preference Optimization (DPO)
. The prompt format used is
ChatML
.
Model description
Model type:
A 3B parameter GPT-like model fine-tuned on a mix of publicly available datasets using DPO.
Despite its compact dimensions, the model achieves outstanding scores in both MT-Bench
MT-Bench
and
AlpacaEval
benchmarks, surpassing the performance of considerably larger models.
Model
Size
Alignment
MT-Bench (score)
AlpacaEval (win rate %)
StableLM-Tuned-α 🦜
7B
SFT
2.75
-
MPT-Chat
7B
SFT
5.42
-
Falcon-Instruct 🦅
40B
SFT
5.17
45.71
Orca-2
13B
SFT
6.15
-
Xwin-LMv0.1
7B
PPO
6.19
87.83
Llama2-Chat 🦙
7B
RLHF
6.26
71.37
TÜLU 2 🐫
7B
DPO
6.27
85.1
Guanaco 🦙
65B
SFT
6.41
71.80
Rocket
🦝
3B
DPO
6.56
79.75
Llama2-Chat 🦙
13B
RLHF
6.65
81.09
Zephyr-7b-α 🪁
7B
DPO
6.88
-
Vicuna v1.3 🦙
33B
SFT
7.12
88.99
Zephyr-7b-β 🪁
7B
DPO
7.34
90.60
WizardLM v1.0 🦙
70B
SFT
7.71
-
GPT-3.5-turbo
-
RLHF
7.94
89.37
Specifically, across various categories within the MT-Bench evaluation, Rocket-3B demonstrates impressive performance when compared to larger open models such as Llama2-Chat-7B, Falcon-40B-Instruct, and Guanaco-65B.
MT-Bench detailed score for first and second turn
In MT-Bench, Rocket 🦝 scores 6.99 in the first turn and 6.13 in the second turn, with an average score of 6.56. These scores reflect the model's performance in understanding and generating text during different parts of a conversation.
Model
First turn
Second turn
Average
Rocket
🦝
6.99
6.13
6.56
AlpacaEval detailed scores
In AlpacaEval, Rocket 🦝 achieves a near 80% win rate, coupled with an average response length of 1,242 tokens, indicating its effectiveness in producing detailed responses.
Model
Win rate
Std error
Average length
Rocket
🦝
79.75
1.42
1242
Other benchmarks
Metric
Value
Average
51.00
ARC (25-shot)
50.51
HellaSwag (10-shot)
76.45
MMLU (5-shot)
45.51
TruthfulQA (0-shot)
54.38
Winogrande (5-shot)
67.8
GSM8K (5-shot)
37.91
DROP (3-shot)
24.49
Intended uses & limitations
Initially, we fine-tuned the model using a dataset created by merging and curating multiple datasets, available on the HuggingFace Hub. This dataset will be released to the public soon. We further enhanced the model's performance using DPO, selecting samples from the
openbmb/UltraFeedback
and
BAAI/JudgeLM-100K
datasets. The outcome is a highly effective chat model with a 3 billion parameter scale.
Input Format
The model is trained with the ChatML format:
<|im_start|>system
System message here.<|im_end|>
<|im_start|>user
Your message here!<|im_end|>
<|im_start|>assistant
Here's how you can run the model using 🤗 Transformers:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model = AutoModelForCausalLM.from_pretrained("pansophic/rocket-3B", trust_remote_code=True, torch_dtype=torch.bfloat16).to("cuda")
tokenizer = AutoTokenizer.from_pretrained("pansophic/rocket-3B", trust_remote_code=True, torch_dtype=torch.bfloat16)
streamer = TextStreamer(tokenizer)
prompt = """<|im_start|>system{system}<|im_end|><|im_start|>user{user}<|im_end|><|im_start|>assistant"""
system = "You are a helpful assistant."
user = "How are you?"# Apply the ChatML format
prompt = prompt.format(system=system, user=user)
# Tokenize the prompt
inputs = tokenizer(prompt, return_tensors="pt", return_attention_mask=False).to("cuda")
generated_text = model.generate(**inputs, max_length=3084, top_p=0.95, do_sample=True, temperature=0.7, use_cache=True, streamer=streamer)
# <|im_start|>system# You are a chef who makes everything sound like a secret culinary masterpiece, even everyday meals.<|im_end|># <|im_start|>user# How to cook an omelette?<|im_end|># <|im_start|>assistant# Ah, the art of crafting the perfect omelette, a secret culinary masterpiece indeed.# Begin by gently whisking two to three eggs in a mixing bowl, and then pour the silky liquid into a non-stick pan.# Allow the eggs to dance and sizzle as you swiftly tilt the pan to spread the joy throughout the entire omelette universe.# As the edges begin to set, fold the omelette in half with a gentle flourish, and you'll witness a stunning display of culinary prowess.# Enjoy this enchanting creation, and you'll be transported to a world of secret culinary mastery.<|im_end|>
Bias, Risks, and Limitations
Unlike ChatGPT, which incorporates in-the-loop filtering of responses and is aligned during the RLHF phase for safe completions, our model lacks these features. Consequently, it may generate problematic outputs, particularly when prompted in certain ways. Below is the score of the model on Toxigen benchmark.
*
The model name is inspired by the small but formidable character from 'Guardians of the Galaxy'. Similar to its namesake, this model, with its 3 billion parameters, showcases remarkable efficiency and effectiveness, challenging larger models despite its smaller size."
rocket-3B-llamafile huggingface.co is an AI model on huggingface.co that provides rocket-3B-llamafile's model effect (), which can be used instantly with this Mozilla rocket-3B-llamafile model. huggingface.co supports a free trial of the rocket-3B-llamafile model, and also provides paid use of the rocket-3B-llamafile. Support call rocket-3B-llamafile model through api, including Node.js, Python, http.
rocket-3B-llamafile huggingface.co is an online trial and call api platform, which integrates rocket-3B-llamafile's modeling effects, including api services, and provides a free online trial of rocket-3B-llamafile, you can try rocket-3B-llamafile online for free by clicking the link below.
Mozilla rocket-3B-llamafile online free url in huggingface.co:
rocket-3B-llamafile is an open source model from GitHub that offers a free installation service, and any user can find rocket-3B-llamafile on GitHub to install. At the same time, huggingface.co provides the effect of rocket-3B-llamafile install, users can directly use rocket-3B-llamafile installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
rocket-3B-llamafile install url in huggingface.co: