GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(ai): add gateway evaluation providers by rekram1-node · Pull Request #50665 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Sep 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

  • add OpenRouter.experimental.evaluation(...) through OpenRouter's System One endpoint
  • add VercelAIGateway.experimental.evaluation(...) through Vercel's provider-neutral /v1/evaluate endpoint
  • type gateway-specific request options and preserve routing, generation, provider, usage, and cost metadata
  • retain TypeSafe and Zen behavior while making the shared System One model generic over request options
  • add a live OpenRouter cassette plus deterministic Vercel request/response coverage

Cloudflare AI Gateway is intentionally not included: its current “Evaluations” feature evaluates stored log datasets in the dashboard and does not expose the runtime typed-question model API implemented here.

Usage

OpenRouter

import { Effect } from "effect"
import { Evaluation, EvaluationClient } from "@opencode/ai/experimental"
import { OpenRouter } from "@opencode/ai/providers"

const model = OpenRouter.configure().experimental.evaluation("typesafe/jev-1.13")

const program = Evaluation.run({
  model,
  state: "I was charged twice. Please refund the duplicate payment.",
  questions: {
    refund: {
      type: "boolean",
      instructions: "Is the customer asking for a refund?",
    },
  },
  options: {
    provider: { zdr: true },
    session_id: "support-session-1",
    user: "customer-1",
  },
})

const result = await Effect.runPromise(
  program.pipe(Effect.provide(EvaluationClient.fetchLayer)),
)

result.answers.refund.probability // number, P(true)
result.providerMetadata?.openrouter?.responseId
result.usage?.providerMetadata?.openrouter?.cost

Vercel AI Gateway

import { Effect } from "effect"
import { Evaluation, EvaluationClient } from "@opencode/ai/experimental"
import { VercelAIGateway } from "@opencode/ai/providers"

const model = VercelAIGateway.configure().experimental.evaluation("typesafe-ai/jev")

const program = Evaluation.run({
  model,
  state: "The support agent issued a full refund.",
  questions: {
    refunded: {
      type: "boolean",
      instructions: "Was a refund issued?",
    },
  },
  options: {
    gateway: {
      zeroDataRetention: true,
      only: ["typesafe-ai"],
    },
  },
})

const result = await Effect.runPromise(
  program.pipe(Effect.provide(EvaluationClient.fetchLayer)),
)

result.answers.refunded.probability
result.providerMetadata?.gateway?.generationId

OpenRouter resolves OPENROUTER_API_KEY. Vercel resolves AI_GATEWAY_API_KEY, then VERCEL_OIDC_TOKEN; both also accept explicit apiKey or auth configuration.

Verification

  • bun run check
  • bun typecheck from packages/ai
  • bun test from packages/ai (1,410 passed, 28 skipped)
  • live OpenRouter typesafe/jev-1.13 cassette replay

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rekram1-node
feat(ai): add gateway evaluation providers
db2aedb
@rekram1-node
rekram1-node force-pushed the gateway-evaluation branch from e026b66 to db2aedb Compare September 22, 2026 15:21
@rekram1-node
rekram1-node merged commit f2bdee6 into v2 Sep 22, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node
rekram1-node deleted the gateway-evaluation branch September 22, 2026 16:37
@felschr felschr mentioned this pull request Sep 23, 2026
feat(session): confidence-gated model tier routing behind optional jev config #50859
Closed
3 of 6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@rekram1-node
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.