Skip to content

[FEATURE] Provider-SDK boundary #49

Description

@LukasNiessen

In short

Only one small 'adapter' module should import the AI SDKs (openai, anthropic, …); everything else uses your own interface. That keeps the app testable and lets you swap models/providers without touching everything.

Problem

Keeps prompts/agents testable and providers swappable behind an interface. Flagship AI rule: concrete and immediately useful — and Python is where most AI apps are written.

Proposal

Ship a preset built on the existing external-dependency rules — e.g. llm_provider_boundary("src/", adapter="**/llm/**", providers=["openai", "anthropic", "google.generativeai", "boto3"]) — so that only the adapter may import provider SDKs and everything else depends on an interface. Under the hood it is should_not().depend_on_external_modules().matching(...) for every folder except the adapter.

Acceptance criteria

  • Importing openai from outside src/llm/** fails; the adapter passes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions