From f8781e68f0f05933ded9ed9a0454b346a9b72f9e Mon Sep 17 00:00:00 2001 From: Halleluyah Oludele Date: Sun, 20 Sep 2026 01:47:20 +0100 Subject: [PATCH 1/2] typesafe: read TYPESAFE_BASE_URL and TYPESAFE_MODEL when Config leaves them empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The names TypeSafe's own SDKs honour, and what a gateway speaking the TypeSafe shape asks for — Vercel AI Gateway serves Jev at https://ai-gateway.vercel.sh/typesafe as typesafe-ai/jev with an AI Gateway key. --- judge/typesafe/typesafe.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/judge/typesafe/typesafe.go b/judge/typesafe/typesafe.go index bdb6534..42c5155 100644 --- a/judge/typesafe/typesafe.go +++ b/judge/typesafe/typesafe.go @@ -59,6 +59,14 @@ const ( // empty. EnvAPIKey = "TYPESAFE_API_KEY" + // EnvBaseURL and EnvModel are read when Config.BaseURL / Config.Model + // are empty — the same names TypeSafe's own SDKs honour, and what a + // gateway that speaks the TypeSafe shape asks you to set (Vercel AI + // Gateway: TYPESAFE_BASE_URL=https://ai-gateway.vercel.sh/typesafe, + // model typesafe-ai/jev, an AI Gateway key as the API key). + EnvBaseURL = "TYPESAFE_BASE_URL" + EnvModel = "TYPESAFE_MODEL" + // evaluatePath is the System One evaluation endpoint. evaluatePath = "/v1/systemone" ) @@ -135,6 +143,12 @@ func New(cfg Config) (*Judge, error) { if key == "" { key = os.Getenv(EnvAPIKey) } + if cfg.BaseURL == "" { + cfg.BaseURL = os.Getenv(EnvBaseURL) + } + if cfg.Model == "" { + cfg.Model = os.Getenv(EnvModel) + } if key == "" { return nil, fmt.Errorf("typesafe: no API key: set Config.APIKey or %s", EnvAPIKey) } From 7c7d07f6043005760e69885a34fe2a494aff8a7b Mon Sep 17 00:00:00 2001 From: Halleluyah Oludele Date: Sun, 20 Sep 2026 01:48:09 +0100 Subject: [PATCH 2/2] pricing: typesafe-ai/jev, the gateway's name for the same model --- pricing/systemone.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pricing/systemone.go b/pricing/systemone.go index acb7910..5488818 100644 --- a/pricing/systemone.go +++ b/pricing/systemone.go @@ -27,6 +27,9 @@ var systemOnePrices = map[string]Price{ "jev-1.13.0": {InputPerMTok: 0.042, OutputPerMTok: 0}, "jev-latest": {InputPerMTok: 0.042, OutputPerMTok: 0}, "jev-preview": {InputPerMTok: 0.042, OutputPerMTok: 0}, + // The same model as Vercel AI Gateway names it; the gateway adds no + // markup (vercel.com/ai-gateway/models/jev, read 2026-09-20). + "typesafe-ai/jev": {InputPerMTok: 0.042, OutputPerMTok: 0}, } // lookupSystemOne resolves a model against the hand-maintained table.