Instructions to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model", dtype="auto") - llama-cpp-python
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model", filename="unsloth.Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model: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 jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model: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 jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Use Docker
docker model run hf.co/jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Ollama:
ollama run hf.co/jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
- Unsloth Studio new
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model 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 jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model 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 jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model to start chatting
- Docker Model Runner
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Docker Model Runner:
docker model run hf.co/jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
- Lemonade
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Run and chat with the model
lemonade run user.DeepSeek-R1-Distill-Llama-4bit-sql-model-Q4_K_M
List all available models
lemonade list
About Model
Fine-tuning is used to convert SQL language into natural language, making it easier for users to understand the business meaning of SQL queries. This fine-tuned model is based on the unsloth framework AND uses the DeepSeek-R1-Distill-Llama-8B pre-trained model under unsloth.
DataSet
Model train
- train/loss: This chart shows the model's loss during training. As the training steps (global step) increase, the loss value drops sharply 和 then stabilizes, indicating that the model is gradually converging.
- train/learning_rate: This chart shows how the learning rate changes over training steps. From the chart, we can see that the learning rate decreases as training progresses, which is likely part of a learning rate decay strategy to prevent the model from oscillating in the later stages of training.
- train/grad_norm: This chart displays the change in gradient norm over training steps. The decrease in gradient norm suggests that the gradients are stabilizing, reducing instability during training.
- train/global_step: This chart shows the increase in global training steps. As the training progresses, the step count gradually increases, indicating the progress of the training process.
- train/epoch: This chart represents the progress of each training epoch. As the global steps increase, the epoch count also steadily grows.
Inference results before 和 after model training:
Prompt
Define SQL query for testing
This is a complex customer analysis query used to test the understanding of the model
query1 = """
SELECT
pc.category_name,
p.product_name,
COUNT(DISTINCT o.customer_id) AS unique_customers,
COUNT(oi.order_id) AS total_sales,
SUM(oi.quantity) AS total_quantity_sold,
ROUND(AVG(oi.unit_price), 2) AS avg_selling_price,
SUM(oi.quantity * oi.unit_price) AS total_revenue,
ROUND(SUM(oi.quantity * oi.unit_price) / COUNT(DISTINCT o.customer_id), 2) AS revenue_per_customer,
MAX(o.order_date) AS last_sale_date,
MIN(o.order_date) AS first_sale_date
FROM product_categories pc
JOIN products p ON pc.category_id = p.category_id
JOIN order_items oi ON p.product_id = oi.product_id
JOIN orders o ON oi.order_id = o.order_id
WHERE
o.order_date >= '2024-01-01'
AND o.order_status = 'completed'
GROUP BY
pc.category_name,
p.product_name
HAVING
total_revenue > 10000
ORDER BY
total_revenue DESC,
unique_customers DESC
LIMIT 15;
Explain use case of this query. """
CREATE TABLE product_categories (category_name VARCHAR, product_name VARCHAR, customer_id INT, order_id INT, order_date DATETIME, status VARCHAR) FROM product_categories JOIN products JOIN order_items JOIN orders WHERE order_date >= '2024-01-01' AND order_status = 'completed' GROUP BY category_name, product_name HAVING total_revenue > 10000This query analyzes the relationship between product categories and customer orders to identify categories and products with the highest revenue in completed orders since 2024. It can help a business understand which products are generating significant revenue and which products are performing well in the category to inform inventory planning and pricing strategies. Below is the business use case for the query:
Use Case:
This query analyzes the relationship between product categories and customer orders to identify categories and products with the highest revenue in completed orders since 2024. It can help a business understand which products are generating significant revenue in the category and which products are performing well in the category to inform inventory planning and pricing strategies.<|end▁of▁sentence|>
Model Download
| Model | Base Model | 下载 |
|---|---|---|
| unsloth/DeepSeek-R1-Distill-Llama-8B | DeepSeek-R1-Distill-Llama-8B | 🤗 HuggingFace |
Usage
If you are unsure how to use GGUF files, refer to one of TheBloke's READMEs for more details, including on how to concatenate multi-part files.
Uploaded model
- Developed by: datalabs-ai
- License: apache-2.0
- Finetuned from model : unsloth/DeepSeek-R1-Distill-Llama-8B
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 9
4-bit
8-bit
Model tree for jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model
Base model
deepseek-ai/DeepSeek-R1-Distill-Llama-8B

