Downloads · 30 days
450
6% of all-time downloads
ChristianAzinn/mixtral-8x22b-v0.1-imatrix
mixtral-8x22b-v0.1-imatrix is a text generation model from ChristianAzinn. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
450
6% of all-time downloads
All-time downloads
8K
Public
Repo size
860 GB
Likes
0
Public
Click a slice to open those files.
.gguf867 GB · 100%
From the Hugging Face model README
Model creator: Mistral AI
Original model: Mixtral-8x22B-v0.1.
None so far, but check back when Mistral releases the model officially on HF Hub.
This repo contains GGUF format files for the Mixtral-8x22B-v0.1 text generation model.
These files were converted and quantized with llama.cpp on a consumer RTX 4090.
This model supports a 65536 context window.
Be warned that this model is ENORMOUS and will not run on most consumer hardware! Consider using an I quant (IQ2_XXS, IQ2_XS, IQ3_XS) for better performance per bit.
This repo also contains files uniquely quantized using an importance matrix, which increases response quality at little cost otherwise, supported by llama.cpp as of PR #4861 and supported for K-quants as of PR #4930. The imatrix does nothing to Q8_0, fp16, or fp32, so use another repository for those quantizations.
The files are split in a weird way because llama.cpp/gguf-split bugs out with extra-large models like Mixtral 8x22B. This may be fixed later.
Speaking of which, these files are split because HuggingFace limits file size to 50GB. You may need to merge them using llama.cpp's gguf-split merge functionality, but both llama.cpp and LM Studio (as of latest release) support loading directly from model shards.
The "Original Model" link above links to a repository of HF Transformers-compatible safetensors on the Hub, but the files in this repository (the one whose README you are reading) were quantized directly from a local conversion of the original torrent.
These files are compatible with llama.cpp, LM Studio, Ollama, and any other service built on top of llama.cpp.
There's no good way for me to make a Provided Files section since each is sharded. However, I provide the following quantizations: IQ2_XXS, IQ2_XS, Q2_K, IQ3_XXS, Q3_K_S, Q3_K_M, Q3_K_L, Q4_K_S, Q4_K_M, Q5_K_S, Q5_K_M, Q6_K.
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:
text-generation-webuiUnder Download Model, you can enter the model repo: ChristianAzinn/mixtral-8x22b-v0.1-imatrix and below it, a specific filename to download, such as: mixtral-8x22b-v0.1-imatrix.Q4_K_M.gguf.
Then click Download.
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:
huggingface-cli download ChristianAzinn/mixtral-8x22b-v0.1-imatrix mixtral-8x22b-v0.1-imatrix.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
<details>
<summary>More advanced huggingface-cli download usage (click to read)</summary>
You can also download multiple files at once with a pattern:
huggingface-cli download ChristianAzinn/mixtral-8x22b-v0.1-imatrix --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
For more documentation on downloading with huggingface-cli, please see: HF -> Hub Python Library -> Download files -> Download from the CLI.
To accelerate downloads on fast connections (1Gbit/s or higher), install hf_transfer:
pip3 install hf_transfer
And set environment variable HF_HUB_ENABLE_HF_TRANSFER to 1:
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download ChristianAzinn/mixtral-8x22b-v0.1-imatrix mixtral-8x22b-v0.1-imatrix.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
Windows Command Line users: You can set the environment variable by running set HF_HUB_ENABLE_HF_TRANSFER=1 before the download command.
Make sure you are using llama.cpp from commit d0cee0d or later.
./main -ngl 35 -m mixtral-8x22b-v0.1-imatrix.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<s>[INST] {prompt} [/INST]"
Change -ngl 32 to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
Change -c 32768 to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
If you want to have a chat-style conversation, replace the -p <PROMPT> argument with -i -ins
For other parameters and how to use them, please refer to the llama.cpp documentation
text-generation-webuiFurther instructions can be found in the text-generation-webui documentation, here: text-generation-webui/docs/04 ‐ Model Tab.md.
You can use GGUF models from Python using the llama-cpp-python or ctransformers libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.
For full documentation, please see: llama-cpp-python docs.
Run one of the following commands, according to your system:
# Base ctransformers with no GPU acceleration
pip install llama-cpp-python
# With NVidia CUDA acceleration
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
# Or with OpenBLAS acceleration
CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
# Or with CLBLast acceleration
CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
# Or with AMD ROCm GPU acceleration (Linux only)
CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
# Or with Metal GPU acceleration for macOS systems only
CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
# In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
$env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
pip install llama-cpp-python
from llama_cpp import Llama
# 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 = Llama(
model_path="./mistral-7b-instruct-v0.2.Q4_K_M.gguf", # Download the model file first
n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
)
# Simple inference example
output = llm(
"<s>[INST] {prompt} [/INST]", # Prompt
max_tokens=512, # Generate up to 512 tokens
stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
echo=True # Whether to echo the prompt
)
# Chat Completion API
llm = Llama(model_path="./mistral-7b-instruct-v0.2.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
llm.create_chat_completion(
messages = [
{"role": "system", "content": "You are a story writing assistant."},
{
"role": "user",
"content": "Write a story about llamas."
}
]
)
Here are guides on using llama-cpp-python and ctransformers with LangChain:
Here are guides on using LM Studio to serve this model. The chat UI is very intuitive to get up and running, but don't be afraid to ask in the Discord if you have any trouble. LM Studio also supports serving with the OpenAI API format, running multiple models at once, and serving embedding models.
This README is inspired by those of the legendary TheBloke. They say imitation is the sincerest form of flattery, and I've elected to reuse his "Examples" section because he did it very well and I see no reason to reinvent the wheel.