Skip to content

feat: inject _instance_name from provider name field into config#23

Closed
ekg wants to merge 1 commit intomicrosoft:mainfrom
ekg:feat/named-provider-instances
Closed

feat: inject _instance_name from provider name field into config#23
ekg wants to merge 1 commit intomicrosoft:mainfrom
ekg:feat/named-provider-instances

Conversation

@ekg
Copy link

@ekg ekg commented Feb 27, 2026

Summary

  • amplifier_core/session.py: Inject _instance_name from provider name field into config before loading the provider

When the provider config has a 'name' field (from settings.yaml), inject it as '_instance_name' into the provider config before loading. This enables named provider instances where the same module (e.g., provider-openai) can be used for multiple services (openrouter, deepseek, etc.) with different names.

Context

Companion to PR #17 on provider-openai which added _instance_name support for named provider instances.

Test plan

  • Provider with name field gets _instance_name injected
  • Provider without name field falls back to module ID
  • Multiple providers with same module but different names work correctly

🤖 Generated with Amplifier

When the provider config has a 'name' field (from settings.yaml),
inject it as '_instance_name' into the provider config before loading.
This enables named provider instances where the same module
(e.g., provider-openai) can be used for multiple services
(openrouter, deepseek, etc.) with different names.

Companion to PR microsoft#17 on provider-openai which added _instance_name
support for named provider instances.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@bkrabach
Copy link
Collaborator

bkrabach commented Mar 9, 2026

Thanks for the idea, @ekg. Named multi-instance provider support has since shipped in v1.0.12 via PR #41 and #42 — providers now get proper instance_id extraction, multi-instance validation, and snapshot-based remapping. The _instance_name injection approach in this draft was heading in the right direction, but the final implementation took a more robust path. Closing as superseded by the instance_id architecture. If you need a separate human-readable display name on top of instance_id, happy to discuss a new PR against the current codebase.

@bkrabach bkrabach closed this Mar 9, 2026
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.

2 participants