Using Metrum AI Bench with an Agent
Give instructions to your AI agent in natural language. The agent carries them out through the Metrum AI Bench MCP tools or the API.
You: "Run the Llama 3.1 70B benchmark on my H200 server and show me the results."
Agent: (creates project → creates workload → creates scenario → executes → reads results)
Pick a Path
| If your agent will... | It calls | It needs |
|---|---|---|
| Run shell commands | MCP tools through metrum-mcp-call | The URL of a Metrum AI Bench MCP server |
| Make HTTP calls directly | The API | A personal access token from Settings → Tokens |
The MCP tools cover projects, workloads, scenarios, single-scenario runs, results, and KYAI. The API covers everything, including the project editor, distributed KV cache, and Pulse. See What Agents Can Do.
Path 1: MCP Tools
If your agent can run shell commands, the metrum-mcp-call helper is the
simplest setup. It ships with benchctl. See the CLI page for
install instructions.
Point the helper at an MCP server
metrum-mcp-call calls an MCP server over streamable HTTP. Set its URL in one
of these ways:
- The
METRUM_MCP_URLenvironment variable. - The
--urloption on each call. - The
mcp_urlkey in the CLI config file.
When the MCP server requires a bearer token, set METRUM_MCP_BEARER_TOKEN.
The MCP server calls the API with its own token. It uses METRUM_JWT_TOKEN
when that is set, or the token that benchctl auth login saved when its
API URL matches the server's.
Tell your agent what to do
Create a project called "Llama 3.1 70B agent demo". Add a workload for meta-llama/Llama-3.1-70B-Instruct on vLLM 0.6.3 using metrumbench-llm. Add a scenario with concurrency 8, 512 input tokens, 256 output tokens, 10 requests. Execute it on my server at
<hostname>and then show me the results.
The agent translates that into calls like these:
metrum-mcp-call create_project \
'{"project_name":"Llama 3.1 70B agent demo","visibility":"private"}'
metrum-mcp-call create_workload \
'{
"project_name": "Llama 3.1 70B agent demo",
"code": "llama-70b-vllm-baseline",
"tool_code": "metrumbench-llm",
"model_code": "meta-llama/Llama-3.1-70B-Instruct",
"framework_code": "vllm",
"version": "0.6.3"
}'
metrum-mcp-call create_scenario \
'{
"project_name": "Llama 3.1 70B agent demo",
"workload_code": "llama-70b-vllm-baseline",
"code": "c8-isl512-osl256",
"concurrency": 8,
"input_tokens": 512,
"output_tokens": 256,
"num_requests": 10
}'
metrum-mcp-call execute_scenario \
'{
"project_name": "Llama 3.1 70B agent demo",
"workload_code": "llama-70b-vllm-baseline",
"scenario_code": "c8-isl512-osl256",
"server_hostname": "<your-server-hostname>"
}'
metrum-mcp-call query_benchmark_results \
'{"project_name":"Llama 3.1 70B agent demo","limit":50}'
List the tools the server offers with metrum-mcp-call --list-tools.
Change a project that has run
A project that has run cannot be changed. On such a project, create_workload,
create_scenario, create_kyai_workload, and create_kyai_scenario fail. The
API error has the message project_executed. Copy the project, then change
the copy:
metrum-mcp-call list_projects '{}'
metrum-mcp-call copy_project \
'{"project_uuid":"<project-uuid>","new_name":"Llama 3.1 70B agent demo v2"}'
copy_project takes project_uuid (required, from list_projects),
new_name, account_id, and org_id. Without new_name, the copy is named
<name> (copy). Without org_id, the tool uses your default workspace. Pass
org_id to copy a project from another workspace.
Path 2: API
If your agent only makes HTTP calls, use the API.
Generate a token in the UI
Open Settings → Tokens in the Metrum AI Bench dashboard. Under Personal
API Tokens, give the token a name, for example agent-ci-runner, pick an
expiry period, and click Generate Token. Copy the token that appears.
The page shows it once. If you lose it, generate a new one and revoke the old one on the same page.
Export the token
Hand the token and the API URL to the agent's environment. The API URL below
points to the hosted control plane at https://bench.metrum.ai. If your
deployment uses a different host, substitute it.
export METRUM_JWT_TOKEN="<the-copied-token>"
export METRUM_API_URL="https://bench.metrum.ai/api/postgrest"
The token is a JWT. Its account_id claim is your account UUID, and its
org_id claim is the workspace you picked. The API enforces your roles on
every request, so the agent can do only what you can do.
Tell your agent what to do
For the same instruction as above, the agent makes calls like these:
curl -X POST "$METRUM_API_URL/rpc/create_project" \
-H "Authorization: Bearer $METRUM_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"p_owner_account_id": "<account_id claim of the token>",
"p_project_name": "Llama 3.1 70B agent demo",
"p_visibility_code": "private",
"p_org_id": "<org_id claim of the token>"
}'
curl -X POST "$METRUM_API_URL/rpc/create_workload" \
-H "Authorization: Bearer $METRUM_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"p_owner_account_id": "<account_id claim of the token>",
"p_project_name": "Llama 3.1 70B agent demo",
"p_workload_name": "Llama 3.1 70B vLLM baseline",
"p_workload_code": "llama-70b-vllm-baseline",
"p_tool_code": "metrumbench-llm",
"p_model_code": "meta-llama/Llama-3.1-70B-Instruct",
"p_framework_code": "vllm",
"p_version": "0.6.3"
}'
curl -X POST "$METRUM_API_URL/rpc/create_scenario" \
-H "Authorization: Bearer $METRUM_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"p_owner_account_id": "<account_id claim of the token>",
"p_project_name": "Llama 3.1 70B agent demo",
"p_workload_code": "llama-70b-vllm-baseline",
"p_scenario_name": "C8 ISL512 OSL256",
"p_scenario_code": "c8-isl512-osl256",
"p_concurrency": 8,
"p_input_sequence_length": 512,
"p_output_sequence_length": 256,
"p_num_requests": 10
}'
curl -X POST "$METRUM_API_URL/rpc/execute_scenario" \
-H "Authorization: Bearer $METRUM_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"p_owner_account_id": "<account_id claim of the token>",
"p_project_name": "Llama 3.1 70B agent demo",
"p_workload_code": "llama-70b-vllm-baseline",
"p_scenario_code": "c8-isl512-osl256",
"p_server_hostname": "<your-server-hostname>"
}'
curl "$METRUM_API_URL/v_benchmark_results?project_name=eq.Llama%203.1%2070B%20agent%20demo&limit=50" \
-H "Authorization: Bearer $METRUM_JWT_TOKEN"
To build a whole project in one call, the agent can use save_project_config.
To check a run before it starts, it uses preflight_project_run. See
Project Lifecycle.
The API Reference lists the RPCs and views by area.
What Agents Can Do
The MCP server's default profile offers the tools below. The full profile,
for developers, adds runner, ingest, and provider tools.
Manage benchmark metadata
- Projects:
create_project,copy_project,list_projects - Workloads:
create_workload,list_workloads - Scenarios:
create_scenario,list_scenarios - Identity and organizations:
get_current_user_context,list_organizations,get_organization - Model catalog:
list_model_catalog,create_ai_model,add_model_from_huggingface,create_model_family,estimate_model_memory - Framework catalog:
list_framework_catalog,create_framework_version - Hardware catalog:
list_hardware_catalog
Execute benchmarks
execute_scenario: submit one scenario to a server.get_job_status: poll a single job.list_jobs: list jobs with filters.
Read results and analytics
- Results:
query_benchmark_results,query_job_outputs,compare_jobs - Telemetry:
query_telemetry_summary,query_hardware_utilization - Comparisons:
query_model_comparison,query_framework_comparison,query_quantization_comparison,query_concurrency_scaling,query_parameter_sensitivity - Cost:
query_cost_efficiency,query_run_cost_summary - Leaderboard:
query_leaderboard - Project runs:
query_project_runs - Server status:
query_server_status
Manage servers and endpoints
register_server,list_servers,check_server_readinesscreate_model_endpoint,list_model_endpoints
Run KYAI evaluations
create_kyai_snapshot,import_kyai_snapshot_prompts,get_kyai_snapshot_import_status,list_kyai_snapshots,list_kyai_snapshot_promptscreate_kyai_candidate_endpoint,list_kyai_candidate_endpointscreate_kyai_generation_system_prompt,list_kyai_generation_system_prompts,create_kyai_judge_system_prompt,list_kyai_judge_system_promptscreate_kyai_judge_config,list_kyai_judge_configscreate_kyai_workload,create_kyai_scenariocreate_kyai_generation_run,create_kyai_evaluation_runquery_kyai_generation_outputs,query_kyai_resultsget_kyai_generation_run,get_kyai_judge_runlist_kyai_generation_runs,list_kyai_judge_runs
Only in the full profile
recommend_model_for_hardware,recommend_hardwareget_run_ai_eval_report,get_project_ai_eval_report
Only through the API
These features have no MCP tool. The agent calls the API for them:
| Feature | Reference |
|---|---|
| Project editor: read, save every workload type in one call, pre-run checks, run a whole project | Project Lifecycle |
| Distributed KV cache | Distributed KV Cache |
| Pulse Views | Pulse Views |
Where to Go Next
- API Reference lists the RPCs and views by area.
- CLI covers the full
benchctlcommand surface.