Views
No views yet
vLLM for efficient embedding generation, as suggested by the project's GitHub repository. The following example demonstrates how to set up a vLLM server and use the model to generate embeddings for text inputs. This is a crucial step for the ranking and filtering pipeline described in the paper.vLLM installed. You can typically install it via pip:pip install vllmvLLM server for the GRAST-SQL model in a separate terminal or background process. This command specifies using griffith-bigdata/GRAST-SQL-0.6B-BIRD-Reranker as the model, enabling embedding generation.1CUDA_VISIBLE_DEVICES=0,1 vllm serve griffith-bigdata/GRAST-SQL-0.6B-BIRD-Reranker \
2 --port 8000 \
3 --max-model-len 8192 \
4 --tensor-parallel-size 2 \
5 --task embedding \
6 --gpu-memory-utilization 0.8vLLM server is running, you can connect to it and generate embeddings programmatically:1from vllm import LLM, SamplingParams
2
3# Ensure the vLLM server is running at the specified port.
4# Replace with the actual path to your GRAST-SQL model checkpoint if different.
5model_path = "griffith-bigdata/GRAST-SQL-0.6B-BIRD-Reranker"
6llm = LLM(
7 model=model_path,
8 tensor_parallel_size=1, # Adjust based on your GPU setup
9 dtype="auto",
10 max_model_len=8192,
11 enforce_eager=True,
12 trust_remote_code=True,
13 gpu_memory_utilization=0.8,
14 task="embedding", # Essential for embedding models
15)
16
17# Example texts for which to generate embeddings
18text_list = [
19 "List all tables related to user activity.",
20 "Find columns for product price and description."
21]
22
23# Generate embeddings
24# The `llm.encode` method is used when the vLLM server is started with --task embedding.
25embeddings = llm.encode(texts=text_list)
26
27for i, text in enumerate(text_list):
28 print(f"Text: '{text}'")
29 print(f"Embedding shape: {embeddings[i].shape}")
30 print(f"First 5 embedding dimensions: {embeddings[i][:5]}
31")
32
33# These embeddings can then be utilized by the GRAST-SQL framework
34# for tasks like column ranking and schema filtering.
1@misc{hoang2025scalingtext2sqlllmefficientschema,
2 title={Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankers},
3 author={Thanh Dat Hoang and Thanh Tam Nguyen and Thanh Trung Huynh and Hongzhi Yin and Quoc Viet Hung Nguyen},
4 year={2025},
5 eprint={2512.16083},
6 archivePrefix={arXiv},
7 primaryClass={cs.DB},
8 url={https://arxiv.org/abs/2512.16083},
9}