Skip to content

LLM backend plugins#93

Open
jtoman wants to merge 3 commits into
masterfrom
jtoman/llm-backend-plugins
Open

LLM backend plugins#93
jtoman wants to merge 3 commits into
masterfrom
jtoman/llm-backend-plugins

Conversation

@jtoman

@jtoman jtoman commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Instead of hardcoding "anthropic" and "openai", we generalize ProviderKind into an abstract class, one with two key dynamic dispatches that encapsulate the behavior we would case split over the two constants for: selecting the correct memory tool implementation and text/file document rendering. This new ABC is called ProviderServices, and is threaded through everywhere the old ProviderKind was.

Further, the actual providers are now auto-discovered and loaded via importlib.metadata entrypoints under certora.autoprove.llm_provider. These entrypoints are expected to resolve to an instance of ProviderSpec, which describes how to select which provider to use for a model name, and the provider itself. The provider is responsible for taking the model name and configuration options and producing a modelprovider; itself encapsulates the model "builder" (itself parameterized over caching/thinking behavior) and the "provider services", which is the ABC described above.

As a validation of this approach, the existing OpenAI and anthropic providers have been moved to be "built in plugins". In principle adding Kimi, Qwen, Deepseek, etc. should simply be a matter of implementing the various Provider apis. Common base classes/abstractions are provided for the anticipated common cases to cut down on boilerplate.

While doing this refactoring, took the opportunity to clean up some apis; including removing the (deprecated and very broken) get_checkpointer, the composer.workflow.providers shim, and other now unused and orphan llm builders.

Instead of hardcoding "anthropic" and "openai", we generalize
ProviderKind into an abstract class, one with two key dynamic
dispatches that encapsulate the behavior we would case split over the
two constants for: selecting the correct memory tool implementation and
text/file document rendering. This new ABC is called ProviderServices,
and is threaded through everywhere the old ProviderKind was.

Further, the actual providers are now auto-discovered and loaded via
importlib.metadata entrypoints under `certora.autoprove.llm_provider`.
These entrypoints are expected to resolve to an instance of
ProviderSpec, which describes how to select which provider to use for a
model name, and the provider itself. The provider is responsible for
taking the model name and configuration options and producing a
modelprovider; itself encapsulates the model "builder" (itself
parameterized over caching/thinking behavior) and the "provider
services", which is the ABC described above.

As a validation of this approach, the existing OpenAI and anthropic
providers have been moved to be "built in plugins". In principle adding
Kimi, Qwen, Deepseek, etc. should simply be a matter of implementing the
various Provider apis. Common base classes/abstractions are provided for
the anticipated common cases to cut down on boilerplate.

While doing this refactoring, took the opportunity to clean up some
apis; including removing the (deprecated and very broken)
get_checkpointer, the composer.workflow.providers shim, and other now
unused and orphan llm builders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant