Instructions to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct") model = AutoModelForCausalLM.from_pretrained("cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct
- SGLang
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct with Docker Model Runner:
docker model run hf.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct
Improve model card: Update paper link, add GitHub link and usage example
Browse filesThis PR improves the model card by:
1. Updating the paper link to the official Hugging Face Papers page: [SLM-SQL: An Exploration of Small Language Models for Text-to-SQL](https://huggingface.co/papers/2507.22478).
2. Adding a prominent link to the GitHub repository in the "Important Links" section.
3. Including a "How to use" section with a Python code snippet that demonstrates how to generate SQL from a natural language question using the `transformers` library, including a database schema for better context.
These enhancements will make the model more accessible and easier for the community to understand and use.
1234567891011121314151617181922 unmodified lines42434445464711 unmodified lines59606162636465666768697071727374757677787980818283---pipeline_tag: text-generationlibrary_name: transformerslicense: cc-by-nc-4.0tags:- text-to-sql- reinforcement-learning---# SLM-SQL: An Exploration of Small Language Models for Text-to-SQL### Important Linksπ[Arxiv Paper](https://arxiv.org/abs/2507.22478) |π€[HuggingFace](https://huggingface.co/collections/cycloneboy/slm-sql-688b02f99f958d7a417658dc) |π€[ModelScope](https://modelscope.cn/collections/SLM-SQL-624bb6a60e9643) |## News22 unmodified lines<img src="https://raw.githubusercontent.com/CycloneBoy/slm_sql/main/data/image/slmsql_framework.png" height="500" alt="slmsql_framework">### Main Results<img src="https://raw.githubusercontent.com/CycloneBoy/slm_sql/main/data/image/slmsql_bird_result.png" height="500" alt="slm_sql_result">11 unmodified lines| **Model** | Base Model | Train Method | Modelscope | HuggingFace ||------------------------------------------|------------------------------|--------------|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|| SLM-SQL-Base-0.5B | Qwen2.5-Coder-0.5B-Instruct | SFT | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-0.5B) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-0.5B) || SLM-SQL-0.5B | Qwen2.5-Coder-0.5B-Instruct | SFT + GRPO | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-0.5B) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-0.5B) || CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct | Qwen2.5-Coder-0.5B-Instruct | SFT + GRPO | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct) | [π€ HuggingFace](https://huggingface.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct) || SLM-SQL-Base-1.5B | Qwen2.5-Coder-1.5B-Instruct | SFT | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-1.5B) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-1.5B) || SLM-SQL-1.5B | Qwen2.5-Coder-1.5B-Instruct | SFT + GRPO | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-1.5B) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-1.5B) || CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct | Qwen2.5-Coder-1.5B-Instruct | SFT + GRPO | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct) | [π€ HuggingFace](https://huggingface.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct) || SLM-SQL-Base-0.6B | Qwen3-0.6B | SFT | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-0.6B) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-0.6B) || SLM-SQL-0.6B | Qwen3-0.6B | SFT + GRPO | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-0.6B) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-0.6B) || SLM-SQL-Base-1.3B | deepseek-coder-1.3b-instruct | SFT | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-1.3B ) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-1.3B ) || SLM-SQL-1.3B | deepseek-coder-1.3b-instruct | SFT + GRPO | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-1.3B ) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-1.3B ) || SLM-SQL-Base-1B | Llama-3.2-1B-Instruct | SFT | [π€ Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-1B ) | [π€ HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-1B ) |## Dataset| **Dataset** | Modelscope | HuggingFace ||----------------------------|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|| SynsQL-Think-916k | [π€ Modelscope](https://modelscope.cn/datasets/cycloneboy/SynsQL-Think-916k) | [π€ HuggingFace](https://huggingface.co/datasets/cycloneboy/SynsQL-Think-916k) || SynsQL-Merge-Think-310k | [π€ Modelscope](https://modelscope.cn/datasets/cycloneboy/SynsQL-Merge-Think-310k) | [π€ HuggingFace](https://huggingface.co/datasets/cycloneboy/SynsQL-Merge-Think-310k) || bird train and dev dataset | [π€ Modelscope](https://modelscope.cn/datasets/cycloneboy/bird_train) | [π€ HuggingFace](https://huggingface.co/datasets/cycloneboy/bird_train) |## TODO1234567891011121314151617181922 unmodified lines4243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510611 unmodified lines118119120121122123124125126127128129130131132133134135136137138139140141142---library_name: transformerslicense: cc-by-nc-4.0pipeline_tag: text-generationtags:- text-to-sql- reinforcement-learning---# SLM-SQL: An Exploration of Small Language Models for Text-to-SQL### Important Linksπ[Paper](https://huggingface.co/papers/2507.22478) |\ud83d\udcbb[GitHub Repository](https://github.com/CycloneBoy/slm_sql) |π€[HuggingFace Collection](https://huggingface.co/collections/cycloneboy/slm-sql-688b02f99f958d7a417658dc) |π€[ModelScope](https://modelscope.cn/collections/SLM-SQL-624bb6a60e9643) |## News22 unmodified lines<img src="https://raw.githubusercontent.com/CycloneBoy/slm_sql/main/data/image/slmsql_framework.png" height="500" alt="slmsql_framework">## How to useYou can use the model with the `transformers` library for Text-to-SQL tasks. Make sure you have `transformers` and `torch` installed.```pythonimport torchfrom transformers import AutoTokenizer, AutoModelForCausalLMmodel_name = "cycloneboy/SLM-SQL-0.5B" # Or any other SLM-SQL model from the collectiontokenizer = AutoTokenizer.from_pretrained(model_name)model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype=torch.bfloat16,device_map="auto")# Example for Text-to-SQLdb_schema = """CREATE TABLE Employee (employee_id INTEGER PRIMARY KEY,name TEXT,department TEXT,salary INTEGER);CREATE TABLE Department (department_id INTEGER PRIMARY KEY,name TEXT,location TEXT);"""question = "What are the names of employees in the 'Sales' department earning more than 50000?"prompt = f"Given the database schema:{db_schema}Translate the following question to SQL: {question}"messages = [{"role": "system", "content": "You are a helpful assistant that translates natural language questions into SQL queries."},{"role": "user", "content": prompt}]input_ids = tokenizer.apply_chat_template(messages,add_generation_prompt=True,return_tensors="pt").to(model.device)outputs = model.generate(input_ids,max_new_tokens=256,do_sample=True,temperature=0.7,top_k=50,top_p=0.95)response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)print(response)# Expected output similar to: SELECT name FROM Employee WHERE department = 'Sales' AND salary > 50000```### Main Results<img src="https://raw.githubusercontent.com/CycloneBoy/slm_sql/main/data/image/slmsql_bird_result.png" height="500" alt="slm_sql_result">11 unmodified lines| **Model** | Base Model | Train Method | Modelscope | HuggingFace ||------------------------------------------|------------------------------|--------------|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|| SLM-SQL-Base-0.5B | Qwen2.5-Coder-0.5B-Instruct | SFT | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-0.5B) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-0.5B) || SLM-SQL-0.5B | Qwen2.5-Coder-0.5B-Instruct | SFT + GRPO | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-0.5B) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-0.5B) || CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct | Qwen2.5-Coder-0.5B-Instruct | SFT + GRPO | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-0.5B-Instruct) || SLM-SQL-Base-1.5B | Qwen2.5-Coder-1.5B-Instruct | SFT | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-1.5B) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-1.5B) || SLM-SQL-1.5B | Qwen2.5-Coder-1.5B-Instruct | SFT + GRPO | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-1.5B) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-1.5B) || CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct | Qwen2.5-Coder-1.5B-Instruct | SFT + GRPO | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct) || SLM-SQL-Base-0.6B | Qwen3-0.6B | SFT | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-0.6B) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-0.6B) || SLM-SQL-0.6B | Qwen3-0.6B | SFT + GRPO | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-0.6B) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-0.6B) || SLM-SQL-Base-1.3B | deepseek-coder-1.3b-instruct | SFT | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-1.3B ) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-1.3B ) || SLM-SQL-1.3B | deepseek-coder-1.3b-instruct | SFT + GRPO | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-1.3B ) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-1.3B ) || SLM-SQL-Base-1B | Llama-3.2-1B-Instruct | SFT | [\ud83e\udd16 Modelscope](https://modelscope.cn/models/cycloneboy/SLM-SQL-Base-1B ) | [\ud83e\udd17 HuggingFace](https://huggingface.co/cycloneboy/SLM-SQL-Base-1B ) |## Dataset| **Dataset** | Modelscope | HuggingFace ||---|---|---|| SynsQL-Think-916k | [\ud83e\udd16 Modelscope](https://modelscope.cn/datasets/cycloneboy/SynsQL-Think-916k) | [\ud83e\udd17 HuggingFace](https://huggingface.co/datasets/cycloneboy/SynsQL-Think-916k) || SynsQL-Merge-Think-310k | [\ud83e\udd16 Modelscope](https://modelscope.cn/datasets/cycloneboy/SynsQL-Merge-Think-310k) | [\ud83e\udd17 HuggingFace](https://huggingface.co/datasets/cycloneboy/SynsQL-Merge-Think-310k) || bird train and dev dataset | [\ud83e\udd16 Modelscope](https://modelscope.cn/datasets/cycloneboy/bird_train) | [\ud83e\udd17 HuggingFace](https://huggingface.co/datasets/cycloneboy/bird_train) |## TODO