SDLC Status Dashboard

2026-06-24 07:21:54 +00:00

Current Phase
specification
Phases Done
0 / 8
Completion
0%
Re-enter At
requirements
0 completed8 remaining

Pipeline Progress ?
⚪ not started not yet begun
✏️ draft initial version
🔍 in review under review
🚧 in progress actively worked on
⛔ blocked waiting on dependency
✅ done completed
⏭️ skipped not applicable

Foundation
✏️Draft: initial version requirementsNot Started: not yet begun existing-solutionsNot Started: not yet begun feasibility✏️Draft: initial version specificationNot Started: not yet begun plan
Build
Not Started: not yet begun implementationNot Started: not yet begun testing
Ship
Not Started: not yet begun documentation
❓ Open Questions📖 Vocabulary

Requirements: LLMLarge Language Model. ProviderThe runtime unit owning a model catalog, auth, and stream behavior (e.g. `anthropic`, `openai`). Abstraction

Overview

pi-ai provides a single unified API for chat and image generation across 30+ LLMLarge Language Model. providers, abstracting away differences in wire protocols, authentication, streaming formats, tool-calling schemas, and token/cost accounting. Consumers (the agent runtime, the coding agent, and third-party SDKSoftware Development Kit (the embeddable programmatic API). users) program against one Models collection and one event-stream contract instead of per-provider SDKs.

Stakeholders

Stakeholder Interest
Agent runtime (pi-agent-core) A stable StreamFn contract and message types to drive the agent loop
Coding agent (pi-coding-agent) Broad provider coverage, automatic auth resolution, and a model catalog
SDKSoftware Development Kit (the embeddable programmatic API). / extension authors A clean public API to register custom providers and models
End users Access to their chosen model and subscription with minimal setup

Functional Requirements

Order rows by priority: Must first, then Should, then May.

ID Priority Requirement
FRFunctional Requirement.-01MustThe system shall expose a `Models` collection that routes model lookups and streams by owning provider. Must The system shall expose a Models collection that routes model lookups and streams by owning provider.
FRFunctional Requirement.-02MustThe system shall support the major wire protocols: Anthropic Messages, OpenAI Responses, OpenAI Completions, Google Generative AI, Google Vertex, Mistral Conversations, and Bedrock Converse Stream. Must The system shall support the major wire protocols: Anthropic Messages, OpenAI Responses, OpenAI Completions, Google Generative AI, Google Vertex, Mistral Conversations, and Bedrock Converse Stream.
FRFunctional Requirement.-03MustThe system shall stream assistant responses as an async-iterable event stream emitting `start`, text/thinking/toolcall deltas, `done`, and `error` events. Must The system shall stream assistant responses as an async-iterable event stream emitting start, text/thinking/toolcall deltas, done, and error events.
FRFunctional Requirement.-04Must"aborted"` and never throw out of a stream. Must The system shall encode all stream failures as terminal events with stopReason: "error" \ | "aborted" and never throw out of a stream.
FRFunctional Requirement.-05MustThe system shall resolve provider authentication via a credential store first (OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). or API keyApplication Programming Interface key (ambient provider authentication).), falling back to ambient env-var resolution only when nothing is stored. Must The system shall resolve provider authentication via a credential store first (OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). or API keyApplication Programming Interface key (ambient provider authentication).), falling back to ambient env-var resolution only when nothing is stored.
FRFunctional Requirement.-06MustThe system shall support OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). flows (PKCEProof Key for Code Exchange (OAuth flow used by pi-ai). and device code) for subscription-based providers. Must The system shall support OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). flows (PKCEProof Key for Code Exchange (OAuth flow used by pi-ai). and device code) for subscription-based providers.
FRFunctional Requirement.-07MustThe system shall represent tool definitions and tool calls using TypeBoxThe schema library used for tool parameter definitions (serializable JSON, self-validating). schemas that are serializable and self-validating. Must The system shall represent tool definitions and tool calls using TypeBoxThe schema library used for tool parameter definitions (serializable JSON, self-validating). schemas that are serializable and self-validating.
FRFunctional Requirement.-08MustThe system shall lazily load provider SDKs on first request rather than at import time. Must The system shall lazily load provider SDKs on first request rather than at import time.
FRFunctional Requirement.-09MustThe system shall generate its model catalog (`models.generated.ts`) from live upstream sources (models.dev, OpenRouter, Vercel AI Gateway), filtering to tool-capable models. Must The system shall generate its model catalog (models.generated.ts) from live upstream sources (models.dev, OpenRouter, Vercel AI Gateway), filtering to tool-capable models.
FRFunctional Requirement.-10ShouldThe system shall track token usage and cost per request. Should The system shall track token usage and cost per request.
FRFunctional Requirement.-11ShouldThe system shall support cross-provider handoffs, converting thinking blocks from foreign providers into tagged text. Should The system shall support cross-provider handoffs, converting thinking blocks from foreign providers into tagged text.
FRFunctional Requirement.-12ShouldThe system shall provide per-provider compatibility flags (e.g. `OpenAICompletionsCompat`) auto-detected from baseUrl and overridable per model. Should The system shall provide per-provider compatibility flags (e.g. OpenAICompletionsCompat) auto-detected from baseUrl and overridable per model.
FRFunctional Requirement.-13ShouldThe system shall provide a `faux` in-memory provider for deterministic testing. Should The system shall provide a faux in-memory provider for deterministic testing.
FRFunctional Requirement.-14MayThe system shall provide an image-generation API (`ImagesModels`) parallel to the chat API. May The system shall provide an image-generation API (ImagesModels) parallel to the chat API.
FRFunctional Requirement.-15MayThe system shall preserve a deprecated `/compat` entrypoint for the legacy global API during migration. May The system shall preserve a deprecated /compat entrypoint for the legacy global API during migration.

Non-Functional Requirements

Order rows by priority: Must first, then Should, then May.

ID Priority Category Requirement
NFRNon-Functional Requirement.-01MustThe root `index.ts` shall be side-effect free. Must Compatibility The root index.ts shall be side-effect free.
NFRNon-Functional Requirement.-02MustSynchronous model reads (`getModels`, `getModel`) shall return last-known data without awaiting; `refresh()` shall be the explicit async verb. Must Performance Synchronous model reads (getModels, getModel) shall return last-known data without awaiting; refresh() shall be the explicit async verb.
NFRNon-Functional Requirement.-03MustOAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). token refresh shall use double-checked locking so concurrent requests refresh at most once. Must Reliability OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). token refresh shall use double-checked locking so concurrent requests refresh at most once.
NFRNon-Functional Requirement.-04MustThe system shall not silently fall back to ambient auth after a failed stored-credential refresh. Must Security The system shall not silently fall back to ambient auth after a failed stored-credential refresh.
NFRNon-Functional Requirement.-05ShouldSDKSoftware Development Kit (the embeddable programmatic API). loading shall not block stream creation; setup may run behind a lazily returned stream. Should Performance SDKSoftware Development Kit (the embeddable programmatic API). loading shall not block stream creation; setup may run behind a lazily returned stream.
NFRNon-Functional Requirement.-06ShouldProviderThe runtime unit owning a model catalog, auth, and stream behavior (e.g. `anthropic`, `openai`). factories shall be thin wrappers over a shared `createProvider` helper. Should Maintainability ProviderThe runtime unit owning a model catalog, auth, and stream behavior (e.g. `anthropic`, `openai`). factories shall be thin wrappers over a shared createProvider helper.

Constraints

  • Only tool-call-capable models are cataloged.
  • Generated files (models.generated.ts, *.models.ts) must never be hand-edited.
  • Erasable TypeScript syntax only; ESM only; Node >=22.19.0.

Acceptance Criteria

Every FRFunctional Requirement. and NFRNon-Functional Requirement. shall have at least one acceptance criterion.

Order criteria by FRs first (sorted by ID), then NFRs (sorted by ID).

  • FRFunctional Requirement.-01MustThe system shall expose a `Models` collection that routes model lookups and streams by owning provider.
    • Given a Models collection with multiple registered providers
    • When a consumer requests a model by provider/id
    • Then the owning provider resolves the model and its stream behavior.
  • FRFunctional Requirement.-03MustThe system shall stream assistant responses as an async-iterable event stream emitting `start`, text/thinking/toolcall deltas, `done`, and `error` events.
    • Given a configured provider and a prompt
    • When the consumer calls the stream function
    • Then it receives an AssistantMessageEventStream yielding ordered text/thinking/toolcall deltas and a terminal done event.
  • FRFunctional Requirement.-04Must"aborted"` and never throw out of a stream.
    • Given a provider request that fails mid-stream
    • When the failure occurs
    • Then the stream emits an error event with partial content and a stopReason of error or aborted instead of throwing.
  • FRFunctional Requirement.-05MustThe system shall resolve provider authentication via a credential store first (OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). or API keyApplication Programming Interface key (ambient provider authentication).), falling back to ambient env-var resolution only when nothing is stored.
    • Given a provider with both a stored credential and an ambient env var
    • When auth is resolved
    • Then the stored credential is used and the env var is ignored.
  • FRFunctional Requirement.-07MustThe system shall represent tool definitions and tool calls using TypeBoxThe schema library used for tool parameter definitions (serializable JSON, self-validating). schemas that are serializable and self-validating.
    • Given a tool defined with a TypeBoxThe schema library used for tool parameter definitions (serializable JSON, self-validating). parameter schema
    • When the provider returns a tool call
    • Then the arguments are parsed and available for validation without provider-specific handling.
  • FRFunctional Requirement.-08MustThe system shall lazily load provider SDKs on first request rather than at import time.
    • Given a fresh process importing the root entrypoint
    • When no request has been made
    • Then no provider SDKSoftware Development Kit (the embeddable programmatic API). (@anthropic-ai/sdk, openai, etc.) is loaded.
  • FRFunctional Requirement.-09MustThe system shall generate its model catalog (`models.generated.ts`) from live upstream sources (models.dev, OpenRouter, Vercel AI Gateway), filtering to tool-capable models.
    • Given the model generator
    • When run via npm run generate-models
    • Then per-provider *.models.ts files and the aggregator models.generated.ts are written, containing only tool-capable models.
  • NFRNon-Functional Requirement.-01MustThe root `index.ts` shall be side-effect free.
    • Given a consumer importing the root index.ts
    • When the import completes
    • Then no provider factories, generated catalogs, or OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). implementations have executed as side effects.
  • NFRNon-Functional Requirement.-03MustOAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). token refresh shall use double-checked locking so concurrent requests refresh at most once.
    • Given an expired OAuthOpen Authorization (used for subscription-based provider login: Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot). token and concurrent requests
    • When both attempt to refresh
    • Then exactly one network refresh occurs and both requests use the refreshed token.

Conflicts

None identified yet.

Open Questions

  1. What is the timeline and completion criteria for retiring the /compat entrypoint once coding-agent's ModelManager migration finishes?
  2. Which providers, if any, are considered tier-1 (must-ship) versus community-maintained for the purposes of future feature work?