Skip to main content
Loading navigation

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

What you are building

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

How work is evaluated

Evaluation

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

Datasets

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

How submissions are scored

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

  • 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

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)

Shows the first task, up to three tools, and up to three evidence 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