A capital-markets team wanted to ask its database questions in plain English. The database held a large number of tables of trading, settlement and market data. The people asking knew the business well and had no interest in writing SQL.
Before building anything serious, I needed to know which models could handle the job. Running open-weight models locally was attractive: the data stays inside, and there is no bill per question. The question was whether they were good enough.
What the model had to do
Every question went through the same chain of steps:
- Understand the intent. What is the person asking for?
- Work out the procedure. Which calculations and which order of operations answer it?
- Find the right tables. Choose, from the schema metadata, which tables hold that information.
- Write the SQL.
- Run it.
- Verify the result against a known correct answer.
The last step mattered most for the comparison. Every model ran the same question set, and every answer was checked against a known solution. A query that ran without errors but returned the wrong rows counted as a failure.
Why capital markets is a hard test
The vocabulary is dense. A single question can depend on moving averages, settlement cycles such as T+1 and T+2, order states and corporate actions, and the model has to know what each term means before it can map it onto tables.
The hardest questions were procedures. Asked for the full trade cycle of a symbol, a good answer traces it from the moment it went live through every event that followed. That means several steps, several tables and the right order between them.
What I compared
- Open-weight, run locally: LLaMA and Mistral.
- Closed, through their APIs: Claude, GPT and Gemini.
What I found
On simple lookups, the gap was small. On complex questions it was wide.
The hosted models handled the hard questions well. Asked for a symbol's trade cycle, they laid out a complete, detailed procedure and turned it into queries that held up against the verified answers.
The local models struggled at exactly that point. Once a question needed domain knowledge and several dependent steps, LLaMA and Mistral fell short of the bar the system needed.
What I'd tell someone choosing today
Build your own question set from real questions, with verified answers, before you pick a model. Generic benchmarks won't tell you how a model handles your vocabulary and your schema.
Use a hosted model to set the bar. Then measure any local model against that bar on the same questions. If it clears it, self-hosting earns its place. If it doesn't, you know exactly where it falls short.