Skip to content

beps: add BEP-0015 AI Model Provider Service#33906

Open
pguppy wants to merge 4 commits into
backstage:masterfrom
pguppy:patch-2
Open

beps: add BEP-0015 AI Model Provider Service#33906
pguppy wants to merge 4 commits into
backstage:masterfrom
pguppy:patch-2

Conversation

@pguppy
Copy link
Copy Markdown

@pguppy pguppy commented Apr 14, 2026

beps: BEP-0015 — AI Model Provider Service

This BEP proposes a new core AI model provider service for Backstage, a provider-agnostic, framework-level service that gives backend plugins a stable contract for accessing AI model capabilities without wiring their own SDKs, credentials, or config.

The core problem: there is no standard way for backend features to consume AI capabilities today. Plugin authors that want to add AI must choose a specific provider, wire authentication themselves, define their own config shape, and handle provider-specific error handling and model selection. This leads to repeated implementation across plugins, fragmented credentials, and vendor lock-in at the wrong layer.

The proposal introduces a coreServices.aiModels backend service backed by AI SDK as the provider transport layer, with an extensible aiProviderFactoriesServiceRef (multiton) for contributing provider families. All provider configuration lives under a single ai.providers.* key in app-config.yaml. Provider identity follows the request protocol and auth model, not the model vendor name.

Key design decisions:

  • AIModelsService is the Backstage-owned public contract — consumers use Backstage request/response types, not raw AI SDK types
  • Provider families are contributed via createServiceFactory using the multiton aiProviderFactoriesServiceRef, keeping extensibility at the framework level rather than plugin extension points
  • Built-in provider families (OpenAI, Anthropic, Google, Bedrock, OpenAI-compatible) ship in @backstage/backend-defaults, following the same pattern as built-in URL readers
  • Capabilities are only enabled when explicitly configured; invalid config fails at startup
  • An optional resolveModel() method provides AI SDK-compatible model objects for advanced runtime interop with tools like Mastra, without making that the primary usage pattern
  • Intentionally scoped to model access only, tool execution, context retrieval, and agent runtimes are explicitly out of scope for this BEP

Looking for feedback on the overall direction, the provider family contribution model, and any gaps in the service surface.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

As dicussed in SIG meeting, I have made this into a new core service using multiton to ensure easy extendability for maintainers to expand with there own model providers.

Signed-off-by: Patrick Guppy <171629661+pguppy@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 14, 2026 16:06
@pguppy pguppy requested a review from a team as a code owner April 14, 2026 16:06
@backstage-goalie backstage-goalie Bot added size:large Large pull requests receive a slightly lower priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Apr 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new BEP proposing a core backend AI model provider service for Backstage, including the service contract shape, provider factory extensibility via multiton service refs, and an operator-facing configuration model.

Changes:

  • Introduces BEP 0014 describing a service-first, provider-agnostic AI model access layer for backend consumers.
  • Specifies an extensibility mechanism for provider families (multiton service ref contributions) and a consolidated ai.providers.* configuration approach.
  • Outlines capability gating, startup validation expectations, and an initial provider packaging strategy (plus future HTTP facade considerations).

Comment thread beps/0015-ai-provider-service/README.md Outdated
Comment thread beps/0015-ai-provider-service/README.md Outdated
Comment thread beps/0014-ai-provider-service/README.md Outdated
Comment thread beps/0015-ai-provider-service/README.md Outdated
Comment thread beps/0015-ai-provider-service/README.md Outdated
Corrected typos and improved clarity in the README.

Signed-off-by: Patrick Guppy <171629661+pguppy@users.noreply.github.com>
@pguppy pguppy changed the title docs(bep): new core service ai provider beps: 0014 - AI Model Provider Service Apr 16, 2026
@pguppy pguppy changed the title beps: 0014 - AI Model Provider Service beps: add BEP-0015 AI Model Provider Service Apr 16, 2026
Copilot AI review requested due to automatic review settings April 16, 2026 04:29
@pguppy pguppy requested a review from a team as a code owner April 16, 2026 04:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread beps/0015-ai-provider-service/README.md Outdated
Comment thread beps/0015-ai-provider-service/README.md
Comment thread beps/0015-ai-provider-service/README.md
Comment thread beps/0015-ai-provider-service/README.md Outdated
Comment thread beps/0015-ai-provider-service/README.md Outdated
pguppy and others added 2 commits April 16, 2026 12:45
- Move beps/0014-ai-provider-service/ to beps/0015-ai-provider-service/
  since 0014 is already taken by beps/0014-ai-service/
- Add 'Mastra' and 'runtimes' to Vale vocabulary accept.txt to fix
  failing Verify Docs Quality workflow (10 spelling errors)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Patrick Guppy <patrick.guppy@bunnings.com.au>
- Fix H1 heading to match frontmatter title: 'AI model provider service'
- Fix typo: 'provder' -> 'provider' in summary
- Nest Goals/Non-Goals under Motivation in TOC
- Capitalize section headings to match BEP template:
  Non-goals -> Non-Goals, Design details -> Design Details,
  Release plan -> Release Plan
- Add StreamTextResponse interface with textStream iterable +
  response promise for finish reason and token usage metadata,
  replacing bare AsyncIterable<string> return type
- Fix duplicate 'anthropic' YAML key in example config;
  rename second instance to 'anthropicInternal'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Patrick Guppy <patrick.guppy@bunnings.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:large Large pull requests receive a slightly lower priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants