feat(llm): contract-only SDK-free core + wire-format adapter packages (#298)#323
Merged
Conversation
…#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
…vider-plugins-298
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-providerpackage.What changed
@omadia/llm-provider-api— the versioned, SDK-free contract: DTOs,LlmProvider, model + descriptor types, and the newLlmAdapter/LlmAdapterRegistrycontract. Zero runtime deps; this is what a third-party adapter compiles against.@omadia/llm-providerslimmed to runtime only — model registry, provider catalog, credential resolution, the wire-formatLlmAdapterRegistry, andresolveLlmProvideras a pure registry lookup (no provider switch). Re-exports the contract so existing imports are unchanged. Drops the@anthropic-ai/sdk+openaideps.@omadia/llm-adapter-anthropic+@omadia/llm-adapter-openai— the Anthropic Messages and OpenAI Chat Completions adapters move here with their SDKs; each registers itself viaregister{Anthropic,OpenAi}Adapter.no-restricted-importsnow 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)
@anthropic-ai/sdknoropenai; no concrete adapter in coreNotes
origin/main. Early commitef1e4f7folded keyless-provider support onto the new architecture before feat(llm-provider): support keyless local providers (e.g. Ollama) #308 merged; the merge resolves in favour of the registry version. feat(orchestrator-extras): relevance-gate + LLM-agnostic judge for cross-session recall #310/feat: Lumens (Live Interactivity) 1.1 — canvas-core + Tier-2 producer (server) #315/feat: durable long-term knowledge tier + auto-promotion (KG recall) #317/feat(platform): runtime credentials + flow toolkit + plugin status (spec 004) #318/feat(kg): automatic self-curation — durable coverage grows + duplicates auto-merge #322 merged clean.chatAgent@1resolves a provider through the new registry.Verification
npm run buildgreen;npm run lintgreen (SDK-import ban active incl. new packages); full suite 3469 pass / 0 fail / 4 skipped.Closes #298.