Skip to content

Add canonical LLM contract normalizer - #82

Merged
stackbilt-admin merged 1 commit into
mainfrom
issue-81-canonical-contract
Jun 5, 2026
Merged

stackbilt-admin merged 1 commit into
mainfrom
issue-81-canonical-contract

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Summary

  • Adds src/canonical.ts with exported canonical request/response types plus compatibility helpers:
    • normalizeLLMRequest
    • canonicalToLLMRequest
    • normalizeLLMResponse
  • Keeps current LLMRequest / LLMResponse callers working while mapping legacy aliases into a capability-oriented canonical shape.
  • Documents the gateway boundary in the README:
    client protocol -> gateway adapter -> CanonicalLLMRequest -> llm-providers -> vendor API
  • Adds contract tests for legacy alias normalization, provider-specific option namespacing, canonical routing metadata, and adapter preparation across OpenAI-compatible, Anthropic-compatible, Groq/Cerebras, NVIDIA, and Cloudflare paths.

Validation

  • npm run typecheck
  • npx vitest run src/__tests__/canonical-contract.test.ts
  • npm test

Closes #81.

@stackbilt-admin
stackbilt-admin marked this pull request as ready for review June 5, 2026 20:02
@stackbilt-admin
stackbilt-admin merged commit ad447a8 into main Jun 5, 2026
2 checks passed
@stackbilt-admin
stackbilt-admin deleted the issue-81-canonical-contract branch June 5, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define canonical provider request/response contract

1 participant