Skip to main content
Challenge

Dynamic Hybrid Inference Router with Vercel AI SDK

Routing user requests dynamically between local edge hardware and cloud model endpoints balances latency and cost bounds. You will construct a dynamic routing application using the Vercel AI SDK in TypeScript that inspects request complexity, evaluates edge hardware thermal status, and dispatches queries accordingly. The solution must achieve 95% compliance with target SLA bounds under mixed workload scenarios.

EngineeringHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Develop a hybrid edge/cloud model router using Vercel AI SDK to satisfy low latency targets while preserving hardware thermal safety.

Delivery guide

How work is evaluated

Evaluation

Evaluates routing choices across diverse prompt types and edge thermal states.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

thermal_safety_check

Ensures no request is routed to edge when edge_temp_c exceeds 75C

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

sla_compliance_rate

Proportion of routed requests meeting the requested SLA latency • target: 0.95 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Utilize Vercel AI SDK streaming and middleware capabilities to implement dynamic router middleware

  • Parse hardware metrics (edge CPU/NPU temp, cloud latency SLAs) in real-time context

  • Route short queries to low-power edge accelerators and heavy reasoning tasks to frontier cloud models

  • Implement smooth fallback streaming when local hardware throttles

Resources and assets

Reference links and supporting material

Dataset notes

Prompts of varying lengths combined with simulated thermal telemetry traces from edge devices.

Challenge setup

Evaluates routing choices across diverse prompt types and edge thermal states.

Challenge input

JSON containing prompt_text, prompt_token_count, edge_temp_c, and latency_sla_ms

AI SDK

Offers streamlined AI streaming and middleware primitives in JS/TS.

Evaluated output

JSON returning chosen_route (edge|cloud), estimated_latency_ms, and routing_rationale

Evaluation checks
  • Ensures no request is routed to edge when edge_temp_c exceeds 75C
  • Proportion of routed requests meeting the requested SLA latency • target: 0.95 • range: 0-1
Configured evaluation evidence
  • Benchmark: Edge-Cloud-Routing-Bench
  • Sla Compliance Rate target: 95%
  • 1 public reference case
Configured runtime
  • JavaScript execution harness
  • javascript sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • Vercel AI SDK · Required
  • Anthropic · Optional
  • Anthropic Claude · Optional
Orchestration
  • Vercel AI SDK · Required

Evaluation contract

  • thermal_safety_check · Weight 1
  • sla_compliance_rate · Weight 1

Metrics

  • sla_compliance_rate · Target 0.95

Benchmarks

  • Edge-Cloud-Routing-Bench
  • general

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON containing prompt_text, prompt_token_count, edge_temp_c, and latency_sla_ms

    Output: JSON returning chosen_route (edge|cloud), estimated_latency_ms, and routing_rationale

    Execution harness: JavaScript

Evaluation tools

  • AI SDK · Agent Framework

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Dynamic Hybrid Inference Router with Vercel AI SDK