Open
Conversation
…nfig
Mirrors the existing LLM_SERVER_CONFIG_PATH / OLLAMA_SERVER_CONFIG_PATH
pattern so operators can supply a YAML file that overrides the built-in
embedded bedrock/config.yml without modifying source code.
Changes:
- config.go: add BedrockConfig field mapped to BEDROCK_CONFIG_PATH env var
- bedrock/bedrock.go: DefaultProviderConfig now accepts *config.Config;
reads from BedrockConfig path when set, falls back to embedded config.yml
- providers.go, cmd/ctester/main.go: pass cfg to updated DefaultProviderConfig
- docker-compose.yml: wire BEDROCK_CONFIG_PATH env var and mount
${PENTAGI_BEDROCK_CONFIG_PATH:-./glm_flash_bedrock.yml} into the container
- .env.example: document the new BEDROCK_CONFIG_PATH variable
- glm_flash_bedrock.yml: example config exporting the glm_flash DB provider
(zai.glm-4.7-flash via Bedrock) as a portable YAML file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add BEDROCK_CONFIG_PATH to the AWS Bedrock Provider Configuration table and the full env reference section to document the custom YAML config path feature added in the feature branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Instead of passing BEDROCK_CONFIG_PATH through from the host env (which required users to know the internal container path), set it directly to the fixed mount point /opt/pentagi/conf/bedrock.provider.yml in compose. Users now only need PENTAGI_BEDROCK_CONFIG_PATH pointing to their host file — consistent with how PENTAGI_LLM_SERVER_CONFIG_PATH and PENTAGI_OLLAMA_SERVER_CONFIG_PATH work. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Follow the same two-variable convention used for LLM_SERVER_CONFIG_PATH and OLLAMA_SERVER_CONFIG_PATH: - PENTAGI_BEDROCK_CONFIG_PATH: host-side path to the YAML file, mounted into the container at /opt/pentagi/conf/bedrock.provider.yml - BEDROCK_CONFIG_PATH: in-container path passed to the app, set to /opt/pentagi/conf/bedrock.provider.yml when using the above Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Name field to ProviderConfig; YAML name: key sets the provider
name shown in the UI (e.g. glm_flash)
- Add SeedDefaultProviders to ProviderController: upserts the Bedrock
provider into the DB for all existing users at startup and lazily for
new users on their first Settings page visit
- Editing the YAML and restarting PentAGI automatically propagates new
values with no UI interaction required
- Simplify to a single BEDROCK_CONFIG_PATH variable: compose uses it as
the host-side volume mount path and translates it to the fixed
container path via :+ substitution, eliminating PENTAGI_BEDROCK_CONFIG_PATH
- Fix bedrock_test.go: pass &config.Config{} to DefaultProviderConfig
after its signature was updated to accept a config argument
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
So I tested this change with a fresh install of pentagi , loading all the configuration in the yaml file and got it pre-configured
It was a pain to actually go into each setting and change it on the UI, now just modify the value in yaml file, and restart the pentagi docker container. The new value is reflected. https://github.com/salecharohit/glm-pentagi-via-bedrock created this for testing out the functionality The documentation also states advanced configuration but not showing how to load this config. |
Contributor
|
@salecharohit thank you for the PR, I'll check it this week. |
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.


Description of the Change
Problem
The AWS Bedrock provider in PentAGI only supported a single built-in
config.ymlfor model and pricing definitions, which is embedded at compile time. This made it impossible to use non-standard Bedrock-accessible models (e.g., GLM Flash viazai.glm-4.7-flash) without recompiling the binary or modifying the source config.Solution
Introduce a
BEDROCK_CONFIG_PATHenvironment variable that lets users point to an external YAML file to override the built-in Bedrock provider config. When the variable is unset, the existing embeddedconfig.ymlis used unchanged (fully backward-compatible). When set, the specified file is read at startup instead.Key changes:
backend/pkg/config/config.go— addedBedrockConfig stringfield mapped toBEDROCK_CONFIG_PATHbackend/pkg/providers/bedrock/bedrock.go—DefaultProviderConfig()now accepts*config.Configand branches onBedrockConfigto call eitherconfigFS.ReadFile(embedded) oros.ReadFile(external path)backend/pkg/providers/providers.goandbackend/cmd/ctester/main.go— updated callers to passcfgtoDefaultProviderConfigdocker-compose.yml— propagatesBEDROCK_CONFIG_PATHenv var into the container and mountsPENTAGI_BEDROCK_CONFIG_PATH(defaults to./glm_flash_bedrock.yml) at/opt/pentagi/conf/bedrock.provider.ymlglm_flash_bedrock.yml— new example config for the GLM 4.7 Flash model (zai.glm-4.7-flash) accessible via Bedrock, with per-agent tuned parameters and pricing.env.exampleandREADME.md— documented the new variableCloses #
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
.env.exampleto.envand setBEDROCK_CONFIG_PATH=./glm_flash_bedrock.ymlalong with valid Bedrock credentials (BEDROCK_REGION,BEDROCK_ACCESS_KEY_ID,BEDROCK_SECRET_ACCESS_KEY)docker compose up -d(orgo run ./cmd/pentagifrombackend/)zai.glm-4.7-flashis used for agent callsBEDROCK_CONFIG_PATHand restart — confirm the built-in default config is loaded as beforeTest Results
Provider initializes successfully with the custom config; falls back cleanly to the embedded config when
BEDROCK_CONFIG_PATHis unset.Security Considerations
The file path is read at server startup only, using
os.ReadFilewith the path supplied by the operator via environment variable. No user-controlled input influences the path at runtime. No new network endpoints or permissions introduced.Performance Impact
Negligible — config file is read once at startup. No change to request-path code.
Documentation Updates
Deployment Notes
New environment variable (optional, backward-compatible):
BEDROCK_CONFIG_PATHDocker Compose: If using a custom config file, set
PENTAGI_BEDROCK_CONFIG_PATHto the host path of your YAML file. The compose file mounts it to/opt/pentagi/conf/bedrock.provider.ymland setsBEDROCK_CONFIG_PATHaccordingly. A ready-made example for GLM Flash (glm_flash_bedrock.yml) is included in the repo root.No database migrations or breaking changes required.
Checklist
Code Quality
go fmtandgo vet(for Go code)npm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
Additional Notes
The
glm_flash_bedrock.ymlincluded in the repo root serves as both a working config for the GLM 4.7 Flash model and a reference template for users who want to use any other Bedrock-accessible model not covered by the built-in defaults. The YAML structure mirrors the existing embeddedconfig.ymlformat.