Instructions to use Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M 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 Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M 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 Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama cli -hf Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama cli -hf Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M: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 Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M: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 Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M
Use Docker
docker model run hf.co/Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M with Ollama:
ollama run hf.co/Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M with Docker Model Runner:
docker model run hf.co/Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M
- Lemonade
How to use Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M:Q4_K_M
Run and chat with the model
lemonade run user.DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M-Q4_K_M
List all available models
lemonade list
- Atomic Chat
DeepSeek-R1-Distill-Llama-8B fine-tuned with 12K lines of text-to-sql dataset with russian prompts localization
Info
- Developed by: Tvisterious
- License: mit
- Finetuned from model : unsloth/DeepSeek-R1-Distill-Llama-8B
Model discription and purpose
This middle-size model was trained and quantized to generate SQL commands quickly on middle-end hardware.
Model was fine-tuned with the 10К lines of Tvisterious/gretelai_synthetic_text_to_sql_russian_prompts_localization dataset. It contains more than 80К lines with russian prompts, data base contexts and sql-commands. This is machine-translated origial gretelai/synthetic_text_to_sql dataset, including translation of the database content and filtering parts of sql-commands and containing only SELECT queries. Note that alpaca-prompt was used for fine-tuning. The model has not been tested with prompts in English or other languages, so it may be unstable.
Usage
For using this model you can follow the usage example below for CPU or you can download the gguf-file and use standard llama_cpp functional:
- CPU
from huggingface_hub import hf_hub_download
from llama_cpp import Llama
model_path = hf_hub_download(
repo_id="Tvisterious/DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M",
filename="DeepSeek-R1-Distill-Llama-8B-Text2SQL-RussianDataset_Q4_K_M.gguf",
cache_dir="./models"
)
llm = Llama(
model_path=model_path,
n_ctx=1024,
n_threads=8
)
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
SQL Prompt: {}
### Input:
Company database: {}
### Response:
SQL: {}
"""
response = llm(
alpaca_prompt.format(
"Сколько есть работников с красными машинами?", # instruction 'How many workers have red cars?'
"T_Workers(worker_id, name, age, id_car), T_Cars(car_id, mark, type, color)", # input with DB context
"", # output - leave this blank for generation!
),
max_tokens=256,
temperature=0.7
)
print(response['choices'][0]['text'])
- Downloads last month
- 78
4-bit