Cricket Analyst is a chat app for questions about men's ODI cricket. A Gemini model selects tools for statistics and analysis. Python and SQL calculate the values. The interface shows the tool name, arguments, and raw result next to the answer, so there is a way to check what happened.
The useful distinction is between asking a model to explain a result and asking it to calculate one. In this app, statistics belong to the tools. The model chooses which tool to call and uses its structured result to answer the question.
From a question to an endpoint
A question reaches a FastAPI conversation endpoint. Gemini, accessed through LiteLLM on Vertex AI, sees an advertised set of tool schemas. These include career statistics, player and match lookups, batter-bowler matchups, squad comparison, wicket-response analysis, and chart creation.
The dispatcher checks that the requested tool exists before calling it. Database-backed tools receive the current conversation's repository and session. An unknown tool name or invalid argument shape produces a structured error rather than crashing the conversation loop.
A career-statistics question and a player-matchup question therefore take different paths. Both paths return structured data that the interface can display separately from the model's answer.
Why show the raw result?
A polished sentence can hide a bad lookup. Showing the arguments makes a wrong player, match, or filter easier to notice. Showing the result lets a reader distinguish a source-data problem from an explanation problem.
For example, a question about a player's ODI runs should let someone inspect the tool that was called and the scope of the returned statistics. A convincing answer is not enough if the calculation covers only a subset of the requested matches.
This trace is also useful when debugging. The question, tool request, structured result, and final answer are separate things to inspect. It is possible to narrow a failure to one of those stages instead of treating the entire response as a single model-quality issue.
Charts reuse data
The create_cricket_chart tool works with a dataset a cricket tool has saved in the same conversation. Values are calculated in Python or SQL and stored with a renderer-independent chart specification. The browser renders the specification using Apache ECharts.
That separation supports a follow-up such as “Now show the same as a bar chart.” The conversation can reuse the saved dataset rather than asking the model to recreate its numbers. The interface also provides table and CSV views for inspecting the data behind a chart.
Supported visualizations include bar, line, scatter, donut, heatmap, bubble, and stacked area/bar charts. A supported chart type is an interface capability; it does not establish that every possible statistical question has been validated.
Voice uses a separate path
Voice is optional. Whisper, served through whisper.cpp, turns a recorded question into text. Kokoro provides read-aloud output. These run as separate Cloud Run workers, and their calls appear as cards alongside the cricket tools.
There is an important implementation detail here: voice calls run through the browser flow. They are not tools that Gemini independently chooses during statistics reasoning. Displaying them in a similar format makes the interaction easier to inspect without pretending that every action follows the same execution path.
What the data can support
The app combines imported Cricsheet ball-by-ball data with ESPN player profiles. Its current coverage is men's ODI matches. Tests and T20Is are outside that dataset.
Career statistics describe the matches available through the implemented data path. They should not be presented as official, complete career records. That scope belongs next to the result, not only in a repository note.
The app interface offers a way to inspect tool traces and try the documented sample questions. It is not an answer-accuracy benchmark. A stronger evaluation would use a fixed question set, expected tool selections, independently checked results, and separate reporting for tool-routing errors and answer errors.
Inspect the implementation
Public hosting is currently paused to keep cloud costs down. The repository includes the setup instructions and sample questions. In a configured local instance, start with a player-statistics question, then ask for a chart of a saved result. Check the arguments, result, and visualization together.