Skip to main content

RunMeta

Struct RunMeta 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§temperature: f32

Sampling temperature the run used, recorded in the report summary. Neutral default 0.0.

§backend: String

A short description of what was benchmarked (e.g. the backend/model label). Neutral default "".

§system_prompt: String

A 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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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);
Source

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);
Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for RunMeta

Source§

fn clone(&self) -> RunMeta

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunMeta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RunMeta

Source§

fn default() -> RunMeta

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more