Don’t stuff 500+ tables into the model prompt. Prefer a retrieval-augmented approach: index table/column metadata and small samples (embeddings), retrieve only relevant tables/columns per query, build a compact schema snippet, then call sqlcoder (or phi3) to generate SQL. Fine-tune (LoRA/QLoRA/adapter) only if you need persistent model behavior changes (naming conventions, edge-case transforms) or you can’t achieve accuracy with RAG + runtime grounding.