#[non_exhaustive]pub struct RunMeta {
pub temperature: f32,
pub backend: String,
pub system_prompt: String,
pub persist: Option<Persist>,
pub upload: Option<Upload>,
}Expand description
Run-level metadata recorded on the EvalReport but NOT intrinsic to the generic runner.
EvalReport carries a few fields that are meaningful for LLM/agent runs (the sampling
temperature, a backend label, the shared system_prompt) but have no generic meaning here. Rather
than hardcode LLM assumptions into run_eval, the host supplies them via this struct; the report’s
serialized shape (and therefore the HTML report + saved JSON) is unchanged. A host with no notion of
these can use RunMeta::default (temperature 0.0, empty backend/system_prompt).
#[non_exhaustive]: new run-level metadata can be added without a breaking change. Build it with
RunMeta::new(temperature, backend, system_prompt).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.temperature: f32Sampling temperature the run used, recorded in the report summary. Neutral default 0.0.
backend: StringA short description of what was benchmarked (e.g. the backend/model label). Neutral default "".
system_prompt: StringA run-level prompt/preamble shared across all cases, stored once on the report (shown at the top
of the HTML report’s per-run expander). Neutral default "".
persist: Option<Persist>When set, the run is auto-persisted: after the cases finish, the EvalReport is written as a
JSON RunRecord into the Persist::results_dir and
report.html is regenerated over every run there. None (the default) means compute-only — no
disk I/O. Set it with RunMeta::persist_to (+ optional backend_kind
/ cases_dir).
upload: Option<Upload>When set, the run is auto-uploaded: after the cases finish, the assembled
RunRecord is POSTed to the EvalForge API (evalforge.ai) so it
shows up in the online dashboard. None (the default) means no upload. Set it with
upload_to / upload_from_env (+ optional
upload_model / upload_cases_dir for the
upload-only, no-persist_to case).
Implementations§
Source§impl RunMeta
impl RunMeta
Sourcepub fn new(
temperature: f32,
backend: impl Into<String>,
system_prompt: impl Into<String>,
) -> Self
pub fn new( temperature: f32, backend: impl Into<String>, system_prompt: impl Into<String>, ) -> Self
Create a new RunMeta with the given temperature, backend label, and system prompt.
Sourcepub fn persist_to(
self,
results_dir: impl Into<PathBuf>,
model: impl Into<String>,
) -> Self
pub fn persist_to( self, results_dir: impl Into<PathBuf>, model: impl Into<String>, ) -> Self
Enable automatic persistence for this run: after the cases finish, write the run as
{model}_{timestamp}.json into results_dir and (re)generate results_dir/report.html over
every run saved there. This is what turns a compute-only run into one that saves its JSON + the
HTML report as part of the call — the host no longer wires that up itself.
Sourcepub fn backend_kind(self, kind: impl Into<String>) -> Self
pub fn backend_kind(self, kind: impl Into<String>) -> Self
Record the backend KIND on the persisted run — the report’s Backend column, e.g. "local" /
"remote" — distinct from the descriptive backend label carried on the report. No-op unless
persist_to enabled persistence first.
Sourcepub fn cases_dir(self, dir: impl Into<String>) -> Self
pub fn cases_dir(self, dir: impl Into<String>) -> Self
Record the case directory on the persisted run (shown in the report). No-op unless
persist_to enabled persistence first.
Sourcepub fn upload_to(
self,
project_id: impl Into<String>,
api_key: impl Into<String>,
) -> Self
pub fn upload_to( self, project_id: impl Into<String>, api_key: impl Into<String>, ) -> Self
Enable automatic upload for this run: after the cases finish, POST the assembled
RunRecord to the EvalForge API under project_id, authenticating
with api_key. Independent of persist_to — works with or without it; when
both are set, the saved file and the uploaded record share one record (one timestamp / dedup
key). An upload failure is warned, never fatal, so it can’t drop the eval signal. The endpoint is
fixed to evalforge.ai (no URL to configure).
use eval_core::{run_suite_with_meta, RunMeta};
// Persist locally AND upload to EvalForge — persist's identity is reused for the upload.
let meta = RunMeta::new(0.0, "local: my-model", "sys")
.persist_to("eval/results", "my-model")
.backend_kind("local")
.upload_to("00000000-0000-0000-0000-000000000000", "sk-eval-...");
let _ = run_suite_with_meta(agent, cases, meta);Sourcepub fn upload_from_env(self, project_id: impl Into<String>) -> Self
pub fn upload_from_env(self, project_id: impl Into<String>) -> Self
As upload_to, but reads the API key from the EVALFORGE_API_KEY environment
variable instead of taking it inline. If the variable is unset or empty, upload is left disabled
(upload = None) with a warning rather than failing — the builder stays infallible.
use eval_core::{run_suite_with_meta, RunMeta};
// Upload-only (no local persist), key from EVALFORGE_API_KEY.
let meta = RunMeta::new(0.0, "remote: my-model", "sys")
.upload_from_env("00000000-0000-0000-0000-000000000000")
.upload_model("my-model"); // record identity, since there is no persist target
let _ = run_suite_with_meta(agent, cases, meta);Sourcepub fn upload_model(self, model: impl Into<String>) -> Self
pub fn upload_model(self, model: impl Into<String>) -> Self
Record the model / grouping key on the uploaded run. Only used when there is NO
persist_to target (otherwise persist’s model is reused). No-op unless
upload_to / upload_from_env enabled upload first.
Sourcepub fn upload_cases_dir(self, dir: impl Into<String>) -> Self
pub fn upload_cases_dir(self, dir: impl Into<String>) -> Self
Record the case directory on the uploaded run. Only used when there is NO
persist_to target (otherwise persist’s cases dir is reused). No-op unless
upload_to / upload_from_env enabled upload first.