OLTI QIRICI

Abstract
This paper evaluates the feasibility of using local large language models (LLMs) to perform Text-to-SQL generation under limited computational resources. The study focuses on a small star-schema data mart and investigates whether locally deployed, pre-trained LLMs can correctly translate natural-language queries into executable SQL statements without relying on cloud-based services. Six local LLMs from different providers and model families were evaluated, including two Microsoft Phi models, three DeepSeek models, and one Mistral model, covering a range of model sizes and parameter counts. All models were assessed using prompt-based inference only, without additional training or fine-tuning, to reflect realistic constraints on hardware, time, and resources. The evaluation compares the models in terms of query correctness and response time. The results highlight the strengths and limitations of current local LLMs for Text to-SQL tasks and provide practical insights into their suitability for on-premises and privacy- sensitive analytical environments.

Key words: Generative AI, local LLM, text to SQL, models comparing.

Download PDF