How kaggle/kaggle-benchmarks works
Kaggle Benchmarks is a Python framework for defining and running evaluations of language models. The principal workflow is: a user defines a task, runs it over parameters or dataset rows, the task interacts with a model, assertions validate results, and runs can be recorded for review. The library also supports structured and multimodal inputs, tool use, parallel evaluation, and interactive notebook views. Sampled source confirms task registration, chat creation, schema processing, event dispatch, and Kaggle file persistence; some integration wiring is not shown, so uncertain links are omitted.
Main entry points: tasks.py Task definition and run · llms.py LLM prompt interface · client.py Kaggle task and run files · chats.py Chat lifecycle
Components 20
Evaluation
- Task definition and run
src/kaggle_benchmarks/tasks.py - Dataset and grid evaluation
src/kaggle_benchmarks/orchestration/scheduling.py - Output assertions
src/kaggle_benchmarks/assertions.py - Result types
src/kaggle_benchmarks/results.py - Run records
src/kaggle_benchmarks/runs.py
Model Interaction
- LLM prompt interface
src/kaggle_benchmarks/actors/llms.py - Schema prompting
src/kaggle_benchmarks/prompting.py - Multimodal content
src/kaggle_benchmarks/content_types - Model tools
src/kaggle_benchmarks/tools - Execution environments
src/kaggle_benchmarks/envs
Conversation State
- Chat lifecycle
src/kaggle_benchmarks/chats.py - Conversation messages
src/kaggle_benchmarks/messages.py - LLM responses and streams
src/kaggle_benchmarks/llm_messages.py - Runtime events
src/kaggle_benchmarks/events.py
Persistence and UI
- Client selection
src/kaggle_benchmarks/clients.py - Kaggle task and run files
src/kaggle_benchmarks/kaggle/client.py - Benchmark file outputs
- Notebook visualization
src/kaggle_benchmarks/ui/panel.py
Other components
- Benchmark author
- Wikipedia search service
Connections 21
- Benchmark author → Task definition and run: defines and runs
- Task definition and run → Chat lifecycle: opens chat
- Task definition and run → Run records: creates run
- Task definition and run → Client selection: registers task
- Task definition and run → Output assertions: checks output
- Dataset and grid evaluation → Task definition and run: evaluates function
- Dataset and grid evaluation → Benchmark author: returns results
- LLM prompt interface → Schema prompting: processes schema
- LLM prompt interface → Multimodal content: accepts media
- LLM prompt interface → Conversation messages: builds history
- LLM prompt interface → LLM responses and streams: returns response
- LLM prompt interface → Model tools: accepts tools
- Model tools → Execution environments: executes code
- Chat lifecycle → Conversation messages: tracks messages
- LLM responses and streams → Runtime events: dispatches stream events
- Client selection → Kaggle task and run files: selects client
- Kaggle task and run files → Benchmark file outputs: writes and reads
- Kaggle task and run files → Run records: stores run data
- Notebook visualization → Chat lifecycle: renders chats
- Notebook visualization → Run records: renders results
- Wikipedia search service → Benchmark author: provides search data