from huggingface_hub import HfApi, hf_hub_download repo_id = "ManasAIDev/minicpm5-2b-text2sql"api = HfApi() files = api.list_repo_files(repo_id=repo_id) gguf_files = [f for f in files if f.lower().endswith(".gguf")] for filename in gguf_files: print(f"Downloading: {filename}") hf_hub_download( repo_id=repo_id, filename=filename, local_dir="./models/minicpm5-text2sql", ) Install a compatible llama.cpp build and download the GGUF file from this repository. pip install -U huggingface_hub hf download ManasAIDev/minicpm5-2b-text2sql \ MiniCPM5-2B-SFT.Q4_K_M.gguf \ --local-dir ./models/minicpm5-text2sql The filename must match the file uploaded to the repository. 2. Run inference llama-cli \ --model ./models/minicpm5-text2sql/MiniCPM5-2B-SFT.Q4_K_M.gguf \ --ctx-size 4096 \ --temp 0 \ --n-predict 256 \ --prompt "Convert this question to SQL: List all organizations." This is a basic inference example. For reliable results, use the chat template and prompt structure expected by the fine-tuning dataset. The example does not establish that the model has been tested successfully with this exact prompt. 3. Provide a database schema A schema-aware prompt should include the relevant table and column definitions. Example: ### TaskGenerate a SQL query for the given question. ### Database schemaTable: organizations- organization_id INTEGER- name TEXT- industry TEXT- country TEXT- number_of_employees INTEGER ### QuestionList the five organizations with the most employees. ### SQL Expected SQL: SELECT name, number_of_employeesFROM organizationsORDER BY number_of_employees DESCLIMIT 5; This is an illustrative expected output, not a measured model prediction. Recommended Evaluation The model should be evaluated on a held-out dataset that was not used during training. Metric| PurposeExact-match accuracy| Measures exact agreement with reference SQLExecution accuracy| Measures whether the generated query returns the correct resultValid SQL rate| Measures syntactic validitySchema-grounding accuracy| Measures correct use of tables and columnsJoin accuracy| Measures correctness of multi-table queriesAggregation accuracy| Tests "COUNT", "SUM", "AVG", and "GROUP BY"Filter accuracy| Tests conditions, date ranges, and comparisonsLatency| Measures inference speedPeak memory| Measures deployment resource requirements Results should be reported with the dataset, test-set size, SQL dialect, decoding settings, and evaluation procedure. No numerical benchmark results are claimed in this release. Limitations - The model may generate syntactically valid but semantically incorrect SQL.- Complex joins, nested queries, and unfamiliar schemas may reduce accuracy.- SQL dialect differences can affect query compatibility.- The model may hallucinate table names or column names when schema information is missing.- Quantization can affect generation quality.- Generalization to databases outside the training distribution has not yet been established. Safe deployment Treat generated SQL as untrusted input. Validate queries before execution, use read-only database credentials wherever possible, restrict permitted SQL operations, and apply execution timeouts and resource limits. The model alone should not be considered a SQL security boundary. Intended Audience Developers, AI researchers, database engineers, and builders of local AI applications interested in small language models for natural-language database interaction. License The fine-tuned model is derived from MiniCPM5-2B-SFT. Confirm the upstream license and its redistribution requirements before publishing this repository under Apache-2.0. Also review the rights and licenses of the fine-tuning data. Acknowledgements - "OpenBMB MiniCPM" (https://github.com/OpenBMB/MiniCPM) — base model family- "MiniCPM5-2B-SFT" (https://huggingface.co/openbmb/MiniCPM5-2B-SFT) — fine-tuning base- "Unsloth" (https://github.com/unslothai/unsloth) — fine-tuning and model export tooling Author ManasAIDev A small-language-model project focused on SQL generation, local AI inference, and AI automation.