Skip to content

feat(llm): contract-only SDK-free core + wire-format adapter packages (#298)#323

Merged
Weegy merged 5 commits into
mainfrom
feat/llm-provider-plugins-298
Jun 17, 2026
Merged

feat(llm): contract-only SDK-free core + wire-format adapter packages (#298)#323
Weegy merged 5 commits into
mainfrom
feat/llm-provider-plugins-298

Conversation

@Weegy

@Weegy Weegy commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Finishes #298 (split LLM integrations into installable plugins; keep only the contract in core). The registry-driven selection + add-provider-by-install part already shipped (#300/#306); the remaining gap was that the concrete adapters + vendor SDKs still lived in the core @omadia/llm-provider package.

What changed

  • New @omadia/llm-provider-api — the versioned, SDK-free contract: DTOs, LlmProvider, model + descriptor types, and the new LlmAdapter / LlmAdapterRegistry contract. Zero runtime deps; this is what a third-party adapter compiles against.
  • @omadia/llm-provider slimmed to runtime only — model registry, provider catalog, credential resolution, the wire-format LlmAdapterRegistry, and resolveLlmProvider as a pure registry lookup (no provider switch). Re-exports the contract so existing imports are unchanged. Drops the @anthropic-ai/sdk + openai deps.
  • New @omadia/llm-adapter-anthropic + @omadia/llm-adapter-openai — the Anthropic Messages and OpenAI Chat Completions adapters move here with their SDKs; each registers itself via register{Anthropic,OpenAi}Adapter.
  • Boot wiring — middleware registers both bundled adapters into the default registry before any provider resolves; builder/preview/dynamic-agent paths import the adapter factories from the adapter packages.
  • eslint no-restricted-imports now bans both SDKs everywhere except the two adapter packages.

Adapters are keyed by wire format, not provider id: a new provider speaking an existing wire format needs only a descriptor (already a plugin); a genuinely new protocol adds an adapter package.

Acceptance criteria (#298)

  • Core imports neither @anthropic-ai/sdk nor openai; no concrete adapter in core
  • Anthropic + OpenAI run as separate (bundled) adapter packages; behaviour unchanged
  • Adding a provider = install a plugin; a new wire format = a new adapter package
  • Selection + model list registry-driven
  • Contract is its own versioned package an external dev can compile against

Notes

Verification

npm run build green; npm run lint green (SDK-import ban active incl. new packages); full suite 3469 pass / 0 fail / 4 skipped.

Closes #298.

Weegy added 5 commits June 15, 2026 19:40
…#298)

Finish issue #298 (split LLM integrations into installable plugins): the
provider runtime core no longer contains any concrete adapter or vendor SDK.

- New @omadia/llm-provider-api: the versioned, SDK-free contract (DTOs,
  LlmProvider, model + descriptor types, and the new LlmAdapter contract).
- @omadia/llm-provider slimmed to runtime only: model registry, provider
  catalog, credential resolution, a wire-format LlmAdapterRegistry, and a
  resolveLlmProvider that is now a pure registry lookup (no provider switch).
  Re-exports the contract so existing imports are unchanged. Drops the
  @anthropic-ai/sdk + openai deps.
- New @omadia/llm-adapter-anthropic and @omadia/llm-adapter-openai: the
  Anthropic Messages and OpenAI Chat Completions adapters move here with their
  SDKs; each registers itself via register{Anthropic,OpenAi}Adapter.
- middleware boot registers both bundled adapters into the default registry
  before any provider resolves; app builder/preview paths import the adapter
  factories from the adapter packages.
- eslint no-restricted-imports now bans both SDKs everywhere except the two
  adapter packages.

Adapters are keyed by wire format, not provider id: a new provider speaking an
existing wire format needs only a descriptor (already a plugin); a new protocol
adds an adapter package. Full middleware build green; 113 llm-provider tests pass.
The omadia test env carries the in-flight keyless work (#308) uncommitted on the
same files this refactor rewrites. Port it onto the new architecture so landing
#298 does not revert #308:

- ProviderPolicy.requiresApiKey added to the @omadia/llm-provider-api contract.
- resolveLlmProvider resolves the descriptor first; a provider with
  policy.requiresApiKey:false builds with a non-empty placeholder key instead of
  returning undefined on a missing credential (Ollama / local models).
- llmProviderManifest parsePolicy parses requires_api_key (+ avv/eu hints).

Build green; 37 provider/admin tests pass.
…t helper

Provider resolution now goes through the adapter registry; tests that build a
provider via useBuiltinProviders() need the adapters registered (the app does
this at boot, tests don't). Register both into defaultLlmAdapters in the helper's
beforeEach so any test using it resolves a provider. Fixes the two
llmClassRefGate failures; full suite green.
…vider-plugins-298

# Conflicts:
#	middleware/packages/llm-provider/src/providerCatalog.ts
#	middleware/packages/llm-provider/src/providerFactory.ts
#	middleware/src/platform/llmProviderManifest.ts
@Weegy Weegy merged commit 5bb75ab into main Jun 17, 2026
7 checks passed
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.

Split LLM integrations into installable plugins; keep only the contract in core

1 participant