Instructions to use second-state/Megrez-3B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use second-state/Megrez-3B-Instruct-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="second-state/Megrez-3B-Instruct-GGUF", filename="Megrez-3B-Instruct-Q2_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use second-state/Megrez-3B-Instruct-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf second-state/Megrez-3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/Megrez-3B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf second-state/Megrez-3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/Megrez-3B-Instruct-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 second-state/Megrez-3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf second-state/Megrez-3B-Instruct-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 second-state/Megrez-3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf second-state/Megrez-3B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/second-state/Megrez-3B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use second-state/Megrez-3B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "second-state/Megrez-3B-Instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "second-state/Megrez-3B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/second-state/Megrez-3B-Instruct-GGUF:Q4_K_M
- Ollama
How to use second-state/Megrez-3B-Instruct-GGUF with Ollama:
ollama run hf.co/second-state/Megrez-3B-Instruct-GGUF:Q4_K_M
- Unsloth Studio new
How to use second-state/Megrez-3B-Instruct-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 second-state/Megrez-3B-Instruct-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 second-state/Megrez-3B-Instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for second-state/Megrez-3B-Instruct-GGUF to start chatting
- Docker Model Runner
How to use second-state/Megrez-3B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/second-state/Megrez-3B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use second-state/Megrez-3B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull second-state/Megrez-3B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Megrez-3B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
Update models
Browse files- .gitattributes +13 -0
- Megrez-3B-Instruct-Q2_K.gguf +3 -0
- Megrez-3B-Instruct-Q3_K_L.gguf +3 -0
- Megrez-3B-Instruct-Q3_K_M.gguf +3 -0
- Megrez-3B-Instruct-Q3_K_S.gguf +3 -0
- Megrez-3B-Instruct-Q4_0.gguf +3 -0
- Megrez-3B-Instruct-Q4_K_M.gguf +3 -0
- Megrez-3B-Instruct-Q4_K_S.gguf +3 -0
- Megrez-3B-Instruct-Q5_0.gguf +3 -0
- Megrez-3B-Instruct-Q5_K_M.gguf +3 -0
- Megrez-3B-Instruct-Q5_K_S.gguf +3 -0
- Megrez-3B-Instruct-Q6_K.gguf +3 -0
- Megrez-3B-Instruct-Q8_0.gguf +3 -0
- Megrez-3B-Instruct-f16.gguf +3 -0
- config.json +31 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,16 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Megrez-3B-Instruct-Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
Megrez-3B-Instruct-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
Megrez-3B-Instruct-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
Megrez-3B-Instruct-Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
Megrez-3B-Instruct-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
Megrez-3B-Instruct-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
Megrez-3B-Instruct-Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
Megrez-3B-Instruct-Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
Megrez-3B-Instruct-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
Megrez-3B-Instruct-Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
Megrez-3B-Instruct-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
Megrez-3B-Instruct-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
Megrez-3B-Instruct-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
Megrez-3B-Instruct-Q2_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19e80be86bcc1ba8d55502e08e21e2b3773f596a6942c58c9ee17feb8c1d0d80
|
| 3 |
+
size 1210225952
|
Megrez-3B-Instruct-Q3_K_L.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd3910bb4bff43e9dfd24a2399de72e9df4e4d96c89e56485edeb6d2c867a0a2
|
| 3 |
+
size 1600083232
|
Megrez-3B-Instruct-Q3_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a25f6595ec301e19fa891136ba9fca4532637d7175f0a4a58b3cac0d74981c45
|
| 3 |
+
size 1498912032
|
Megrez-3B-Instruct-Q3_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c7073c289c9ac12bf5996a5403c7527089ddf515396cfaa00d1900699fcde573
|
| 3 |
+
size 1381111072
|
Megrez-3B-Instruct-Q4_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02fdc5027a56e5ee67959e1936449a9b33ec66576de5a707210eb7620b882c90
|
| 3 |
+
size 1726485792
|
Megrez-3B-Instruct-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad234df7dd4083d782c6a5c728cf57712d5a6a45e0c0f2b844e17df3db326c13
|
| 3 |
+
size 1808938272
|
Megrez-3B-Instruct-Q4_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb03fa4b3ac5538aefae5470a7246cf2f544e37bb77c055636cea0c5b3b71b58
|
| 3 |
+
size 1736480032
|
Megrez-3B-Instruct-Q5_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8481ba580d2269fbe944f914b8cf550b8febfaa924f284ec295f5813f870c86b
|
| 3 |
+
size 2051544352
|
Megrez-3B-Instruct-Q5_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a15a33cbedfd418a0df6b2a06d4e3ba415b59853942477b1b407a36d2c111155
|
| 3 |
+
size 2094019872
|
Megrez-3B-Instruct-Q5_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d74436104b795e4afcb2564aea7344667b9da3493ff3ff513dcc0e49ea6ece7e
|
| 3 |
+
size 2051544352
|
Megrez-3B-Instruct-Q6_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bb97f1ee7bdb1dc489320a30959958fc035c85d97c9ce000fdc3c79c08c8d8f5
|
| 3 |
+
size 2396919072
|
Megrez-3B-Instruct-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa6eef13671f94ae70d09d3e5538c5f4e552facc8b83eca0c52d11ad2f7eaa09
|
| 3 |
+
size 3102905632
|
Megrez-3B-Instruct-f16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d829867730264d0c9629853dbb6a2cf921fa29f6bfb2ff706ba57c0b9f6e0c25
|
| 3 |
+
size 5835756832
|
config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "Megrez-3B-Instruct",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"bos_token_id": null,
|
| 9 |
+
"eos_token_id": 120005,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 2560,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 7168,
|
| 14 |
+
"max_position_embeddings": 32768,
|
| 15 |
+
"max_sequence_length": 32768,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
+
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 40,
|
| 19 |
+
"num_hidden_layers": 32,
|
| 20 |
+
"num_key_value_heads": 10,
|
| 21 |
+
"pad_token_id": 120002,
|
| 22 |
+
"pretraining_tp": 1,
|
| 23 |
+
"rms_norm_eps": 1e-05,
|
| 24 |
+
"rope_scaling": null,
|
| 25 |
+
"rope_theta": 5000000.0,
|
| 26 |
+
"tie_word_embeddings": false,
|
| 27 |
+
"torch_dtype": "bfloat16",
|
| 28 |
+
"transformers_version": "4.43.4",
|
| 29 |
+
"use_cache": true,
|
| 30 |
+
"vocab_size": 122880
|
| 31 |
+
}
|