Instructions to use Brijesh-Info/smollm-q 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 Brijesh-Info/smollm-q 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 Brijesh-Info/smollm-q:Q4_K_M # Run inference directly in the terminal: llama cli -hf Brijesh-Info/smollm-q:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Brijesh-Info/smollm-q:Q4_K_M # Run inference directly in the terminal: llama cli -hf Brijesh-Info/smollm-q:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Brijesh-Info/smollm-q:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Brijesh-Info/smollm-q:Q4_K_M
Use Docker
docker model run hf.co/Brijesh-Info/smollm-q:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use Brijesh-Info/smollm-q with Ollama:
ollama run hf.co/Brijesh-Info/smollm-q:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Brijesh-Info/smollm-q with Docker Model Runner:
docker model run hf.co/Brijesh-Info/smollm-q:Q4_K_M
- Lemonade
How to use Brijesh-Info/smollm-q with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Brijesh-Info/smollm-q:Q4_K_M
Run and chat with the model
lemonade run user.smollm-q-Q4_K_M
List all available models
lemonade list
- Atomic Chat
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
SmolLM Model Quantization with GGUF and llama.cpp
This project demonstrates the quantization of the SmolLM model using the GGUF format and llama.cpp to optimize performance for low-resource environments. Quantization reduces model size and inference latency, making it easier to deploy models on devices with limited hardware capabilities.
π Usage
Model ID:
The MODEL_ID refers to the identifier of the model you want to quantize.
Quantization Method:
The QUANTIZATION_METHOD defines the approach used for reducing the precision of the model weights.
Example command:
python quantize_model.py --model_id <MODEL_ID> --quant_method <QUANTIZATION_METHOD>
βοΈ Quantization Methods
The quantization methods follow the naming convention q<bit_depth>_<variant>. Below is a comprehensive list of the available methods and their use cases:
Quant Method Description
q2_k Q4_K for attention.vw and feed_forward.w2 tensors, Q2_K for the rest.
q3_k_l Q5_K for attention.wv, attention.wo, feed_forward.w2 tensors; Q3_K for the rest.
q3_k_m Q4_K for attention.wv, attention.wo, feed_forward.w2 tensors; Q3_K for the rest.
q3_k_s Q3_K for all tensors.
q4_0 The original 4-bit quantization method.
q4_1 Higher accuracy than q4_0 but with faster inference than q5.
q4_k_m Q6_K for half of attention.wv and feed_forward.w2 tensors, Q4_K for the rest.
q4_k_s Q4_K for all tensors.
q5_0 Higher accuracy, higher resource usage, and slower inference than q4.
q5_1 Even higher accuracy with increased resource usage and slower inference.
q5_k_m Q6_K for half of attention.wv and feed_forward.w2 tensors, Q5_K for the rest.
q5_k_s Q5_K for all tensors.
q6_k Q8_K for all tensors.
q8_0 Near float16 precision, but with high resource use. Not recommended for most use cases.
Recommendation: For most cases, use Q5_K_M as it preserves the model's performance while optimizing memory usage. Use Q4_K_M if memory efficiency is more critical.
π Performance Guide
The following table summarizes the trade-offs between quantization methods:
Method Precision Speed Memory Usage Recommended Use Case
q4_0 Medium Fast Low General-purpose, small models
q4_1 Higher Fast Low Faster inference, good accuracy
q5_0 High Moderate Medium When higher accuracy is needed
q5_k_m High Slow Moderate Best balance of accuracy and speed
q6_k Very High Slow High For accuracy-sensitive tasks
q8_0 Very High Very Slow Very High Rarely recommended, only for high-precision tasks
π License
This project is licensed under the MIT License.
π€ Contributing
We welcome contributions! If you'd like to help improve this project, please open an issue or submit a pull request.
π Acknowledgements
This project is based on the model cards and quantization techniques shared by TheBloke.
For more details, visit TheBloke's GitHub.
π§ Contact
For any queries or support, please reach out at [your-email@example.com].
- Downloads last month
- 5
4-bit