Instructions to use TheBloke/Mixtral-8x7B-v0.1-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/Mixtral-8x7B-v0.1-GGUF with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TheBloke/Mixtral-8x7B-v0.1-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TheBloke/Mixtral-8x7B-v0.1-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 TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/Mixtral-8x7B-v0.1-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 TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/Mixtral-8x7B-v0.1-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 TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf TheBloke/Mixtral-8x7B-v0.1-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 TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M
Use Docker
docker model run hf.co/TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use TheBloke/Mixtral-8x7B-v0.1-GGUF with Ollama:
ollama run hf.co/TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use TheBloke/Mixtral-8x7B-v0.1-GGUF with Docker Model Runner:
docker model run hf.co/TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M
- Lemonade
How to use TheBloke/Mixtral-8x7B-v0.1-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheBloke/Mixtral-8x7B-v0.1-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Mixtral-8x7B-v0.1-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
create_tensor: tensor 'blk.0.ffn_gate.weight' not found
Hi!
I have the following error loading the mixtral-8x7b-v0.1.Q8_0.gguf:
llm_load_tensors: ggml ctx size = 0.32 MB
llm_load_tensors: using CUDA for GPU acceleration
ggml_cuda_set_main_device: using device 0 (NVIDIA GeForce RTX 3090) as main device
error loading model: create_tensor: tensor 'blk.0.ffn_gate.weight' not found
llama_load_model_from_file: failed to load model
2023-12-11 16:55:48 ERROR:Failed to load the model.
...
File "/env/lib/python3.10/site-packages/llama_cpp_cuda/llama.py", line 365, in init
assert self.model is not None
AssertionError
Any idea?
PD: TheBloke, many many thanks for your work and time!
You need to use the llama.cpp fork with mixtral support https://github.com/ggerganov/llama.cpp/tree/mixtral
Is there not a Windows 10 binary compiled for this???
Hi, I'm using the right branch (latest pull from mixtral) but still getting the same error:
llm_load_tensors: ggml ctx size = 0.36 MiB
llm_load_tensors: using CUDA for GPU acceleration
error loading model: create_tensor: tensor 'blk.0.ffn_gate.weight' not found
llama_load_model_from_file: failed to load model
llama_init_from_gpt_params: error: failed to load model '/mnt/e/mixtral-8x7b-v0.1.Q4_K_M.gguf'
main: error: unable to load model
In the list of layers produced by the llama _model_loader from running main, I don't see this tensor. I only see tensors like blk.0.ffn_gate.0.weight
Am I missing anything here?
I had the same issue on Apple Metal M2 MAX and it was solved by pulling the /mixtral branch instead of the master branch from llama.cpp then remaking. But you're right that the supposedly missing tensor doesn't appear in the list of created tensors even when it works!
I tried a clean build multiple times but still no luck. Should the mixtral branch work as is or are there any additional changes or patches that are required? Any help is greatly appreciated.
llm_load_tensors: ggml ctx size = 0.36 MiB
llm_load_tensors: using CUDA for GPU acceleration
error loading model: create_tensor: tensor 'blk.0.ffn_gate.weight' not found
llama_load_model_from_file: failed to load model
llama_init_from_gpt_params: error: failed to load model '/mnt/models/mixtral-8x7b-v0.1.Q4_K_M.gguf'
main: error: unable to load model
.../llama.cpp/build$ git status
On branch mixtral
nothing to commit, working tree clean
Final update: I got it working eventually. For some reason building from the branch wasn't working originally but after a few tries it works and I can load the models correctly.
You need to use the llama.cpp fork with mixtral support https://github.com/ggerganov/llama.cpp/tree/mixtral
Can you please explain more, how do we do it ?