AI APIs106 · Module III · Lesson 14 of 14
Lab · 90 min

Lab: A provider-agnostic client

One interface, three providers, benchmarked.

Summary

The APIs course capstone: one interface, three providers, benchmarked.

Key Ideas
  • A provider-agnostic client is a real engineering artifact, not just glue code.
  • Feature parity forces you to understand each provider deeply.
Lab

Build a client library that exposes one Chat/Complete interface backed by three providers: OpenAI, Anthropic, and Ollama (or a local model of your choice). Support streaming, tool calling, and structured outputs across all three (falling back gracefully where a provider does not support a feature). Benchmark: run the same 30-example evaluation on each provider through your client. Report cost, latency, quality.

Deliverables

  • Client library with unified interface.
  • Adapter code for each of the three providers.
  • Benchmark script and 30-example eval set.
  • Report of cost, latency, and quality per provider.

Rubric

  • Abstraction — the caller does not need to know which provider is behind the interface.
  • Feature parity — streaming, tools, and structured outputs work everywhere (or fail loudly).
  • Benchmark rigor — same prompts, same eval, honest numbers.
  • Documentation — a stranger could add a fourth provider.