Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1023 commits
Select commit Hold shift + click to select a range
8f377a6
Update pre-commit.Dockerfile
imranq2 Apr 15, 2026
8644ce9
Remove unnecessary debugging commands from Dockerfile
imranq2 Apr 15, 2026
d22a80d
Merge remote-tracking branch 'origin/switch-to-uv' into switch-to-uv
imranq2 Apr 15, 2026
ef650e7
Add skills documentation and update general purpose configuration
imranq2 Apr 16, 2026
1547d24
Add skills documentation and update general purpose roles
imranq2 Apr 16, 2026
335c384
Update dependencies to latest versions for improved stability and fea…
imranq2 Apr 16, 2026
bb328f3
Refactor environment variable usage across multiple tools and service…
imranq2 Apr 17, 2026
c3dccd2
Update dependencies: bump versions for oidcauthlib, langchain-ai-skil…
imranq2 Apr 17, 2026
63dd57d
Update Dockerfile to pin uv version to 0.11.6 for consistency and rel…
imranq2 Apr 18, 2026
80210ce
Update dependencies in pyproject.toml and uv.lock for version consist…
imranq2 Apr 19, 2026
a5c014c
Refactor Dockerfile to streamline production and development stages, …
imranq2 Apr 19, 2026
d1d2282
Update GITHUB_CACHE_FOLDER path in docker-compose.yml to include proc…
imranq2 Apr 19, 2026
8d701a8
Merge pull request #153 from icanbwell/switch-to-uv
imranq2 Apr 19, 2026
5662e20
Update dependencies in pyproject.toml and modify docker-compose.yml f…
imranq2 Apr 20, 2026
3c53b13
Update oidcauthlib dependency to version 3.0.10 for improved function…
imranq2 Apr 20, 2026
588a2ef
Enhance skill loading mechanism with optional include/exclude lists f…
imranq2 Apr 20, 2026
e6a7b87
Enhance plugin discovery by implementing marketplace.json support and…
imranq2 Apr 20, 2026
b0c1997
Update package versions for cachetools, langchain-openai, oidcauthlib…
imranq2 Apr 20, 2026
05253f1
Add PluginMcpServerEntry support and refactor MarketplaceDirectoryLoa…
imranq2 Apr 20, 2026
dbbcc6b
Add PluginMcpServerEntry support and refactor MarketplaceDirectoryLoa…
imranq2 Apr 20, 2026
7ce6c80
Implement SnapshotCacheStore for MongoDB-backed caching of skill snap…
imranq2 Apr 20, 2026
85bbc70
Refactor snapshot caching to use BaseStore instead of SnapshotCacheSt…
imranq2 Apr 20, 2026
5528b36
Refactor marketplace plugin manager and snapshot serializer for impro…
imranq2 Apr 20, 2026
0379626
Update dependencies for langchain-ai-skills-framework and language-mo…
imranq2 Apr 20, 2026
8188ea0
Implement ResilientCacheStore for improved snapshot caching with auto…
imranq2 Apr 21, 2026
644e2af
Refactor snapshot cache implementation to support multiple backend ty…
imranq2 Apr 21, 2026
2f83c65
Update dependencies and refactor snapshot cache initialization
imranq2 Apr 21, 2026
9861893
Update dependencies and refactor snapshot cache initialization
imranq2 Apr 21, 2026
f46895d
Update docker-compose.yml and pyproject.toml for caching configuratio…
imranq2 Apr 21, 2026
70279dd
Update dependencies to latest versions in pyproject.toml and uv.lock
imranq2 Apr 21, 2026
fae565d
Refactor chat completion manager to improve error handling message co…
imranq2 Apr 21, 2026
6ed58a6
Update language-model-common and langchain-openai dependencies to lat…
imranq2 Apr 21, 2026
c1cc4e4
Comment out local dependencies in docker-compose.yml for cleaner conf…
imranq2 Apr 21, 2026
76e6d1d
Implement ValidatingMongoDBStore for fail-fast MongoDB connection val…
imranq2 Apr 21, 2026
4b41e3f
Add config refresh interval and implement background config refresh loop
imranq2 Apr 21, 2026
009feef
Update caching logic in api.py to use async refresh methods and enhan…
imranq2 Apr 21, 2026
8afd1dd
Add PluginDefinition model and update marketplace loader for plugin s…
imranq2 Apr 22, 2026
cb805ce
Refactor skill management to use PluginSkillStore and update related …
imranq2 Apr 22, 2026
a538224
Rename skill markdown files and update .gitignore and pre-commit conf…
imranq2 Apr 22, 2026
11cd15b
Update dependencies in pyproject.toml and uv.lock for compatibility a…
imranq2 Apr 22, 2026
ba2a037
Rename skill-related files and update references to marketplace for c…
imranq2 Apr 22, 2026
215a36d
Refactor skill loading to remove unnecessary logging and adjust worke…
imranq2 Apr 22, 2026
6b9c35f
Update docker-compose.yml to exclude 'software-developers' from plugi…
imranq2 Apr 22, 2026
52dfc56
Update docker-compose.yml to exclude 'software-developers' from plugi…
imranq2 Apr 22, 2026
b457d8f
Add marketplace-git-cache to .gitignore for improved cache management
imranq2 Apr 22, 2026
f5e6470
Add marketplace cache folder configuration to docker-compose
imranq2 Apr 22, 2026
7798091
Enhance skill synchronization logging and improve plugin definition h…
imranq2 Apr 22, 2026
ef22db9
Update docker-compose.yml to change PLUGINS_COLLECTION default from '…
imranq2 Apr 22, 2026
3b295b5
Update dependencies to latest versions for improved compatibility and…
imranq2 Apr 22, 2026
2557d0b
Update dependencies to latest versions for improved compatibility and…
imranq2 Apr 22, 2026
2f7a7ae
Update docker-compose configuration for GitHub plugin marketplace int…
imranq2 Apr 22, 2026
3bcf66a
Update docker-compose configuration to adjust GitHub cache folder set…
imranq2 Apr 22, 2026
675ec57
Refactor docker-compose.yml to improve clarity of GitHub configuratio…
imranq2 Apr 22, 2026
1d02fe8
Add has_plugins method to check for existing plugins and update start…
imranq2 Apr 23, 2026
9f69687
Add PLUGINS_MARKETPLACE environment variable to docker-compose for pl…
imranq2 Apr 23, 2026
874629c
Update dependencies in docker-compose and pyproject.toml for langchai…
imranq2 Apr 23, 2026
5c56ddd
Bump langchain-ai-skills-framework and langchain-openai versions to 1…
imranq2 Apr 23, 2026
ded6e67
Update language_model_gateway/gateway/api.py
imranq2 Apr 23, 2026
f492b3b
Update langchain-ai-skills-framework and langchain-openai to latest v…
imranq2 Apr 23, 2026
d1a2cd8
Merge pull request #158 from icanbwell/support-plugins-marketplace
imranq2 Apr 23, 2026
35469eb
Add GitHubMarketplacePublisher for skill publishing and enhance envir…
imranq2 Apr 23, 2026
a0865d7
Update docker-compose.yml to clarify marketplace publishing configura…
imranq2 Apr 23, 2026
0b278f2
Add MCP configuration for Google Drive skills server and update depen…
imranq2 Apr 23, 2026
6d3166d
Add MCP configuration for Google Drive skills server and update depen…
imranq2 Apr 23, 2026
e33390e
Add MCP configuration for Google Drive skills server and update depen…
imranq2 Apr 23, 2026
d959926
Add OAuth support to plugin configuration and serialization
imranq2 Apr 23, 2026
2ecf628
Enhance SKILL.md documentation with detailed tool usage and saving in…
imranq2 Apr 23, 2026
6c318ba
Add marketplace and validation scripts for skill management
imranq2 Apr 23, 2026
273e3f9
Rename bwell-skill-creator to bwell-skill-library and update descript…
imranq2 Apr 23, 2026
31dab04
Register MCP display names from tools and update docker-compose for l…
imranq2 Apr 24, 2026
9a4aa1c
Add FHIR query builder skill and prompt writer skill with validation …
imranq2 Apr 24, 2026
e891bd9
Add initial SKILL.md and plugin.json for patient portal finder and JF…
imranq2 Apr 24, 2026
d5e9df2
Update marketplace configuration in MCP server gateway
imranq2 Apr 24, 2026
cbc31c3
Update docker-compose files to configure marketplace plugin settings
imranq2 Apr 24, 2026
c4bed41
Refactor container and command manager to remove unused skill loader …
imranq2 Apr 24, 2026
9fcb515
Refactor caching documentation and remove unused environment variables
imranq2 Apr 24, 2026
2bd0294
Add MCP Tool Discovery documentation and refactor MCP JSON reader
imranq2 Apr 24, 2026
44826ba
Add MCP configuration support and enhance OAuth provider registration
imranq2 Apr 24, 2026
a2c8ffb
Refactor GatewayTokenStorageAuthManager to utilize plugin MCP configs…
imranq2 Apr 25, 2026
3622ce3
Update language-model-gateway-configs/marketplace/plugins/all-employe…
imranq2 Apr 25, 2026
8fdb0b4
Add CMS-Aligned Network commitment and major partnerships documentation
imranq2 Apr 25, 2026
bc97e4f
Merge remote-tracking branch 'origin/write-skill-to-github' into writ…
imranq2 Apr 25, 2026
cc1f8b1
Comment out local language model common directory in docker-compose.yml
imranq2 Apr 25, 2026
c94d1f9
Enhance skills documentation with critical workflow steps for user in…
imranq2 Apr 25, 2026
55fcf70
Update skills display name to 'Skills Library' in .mcp.json
imranq2 Apr 25, 2026
aac6cce
Rename skills section to skills-library and skills-publisher with upd…
imranq2 Apr 25, 2026
3286062
Rename skills section to skills-library and skills-publisher with upd…
imranq2 May 4, 2026
4b69c7d
Rename skills section to skills-library and skills-publisher with upd…
imranq2 May 4, 2026
60ebbdb
Add skills-publisher MCP server and split skills into read/publish en…
imranq2 May 4, 2026
ced34a0
Enable marketplace skill publishing to imran-test branch
imranq2 May 4, 2026
cc6d308
Switch PLUGINS_MARKETPLACE to GitHub source and enable local language…
imranq2 May 4, 2026
316f394
Switch PLUGINS_MARKETPLACE to GitHub source and enable local language…
imranq2 May 4, 2026
2e33ba3
Add skill publish UI with OAuth login and MCP tool proxy
imranq2 May 4, 2026
5156640
Add skill publish router, UI form, and docker-compose for mcp-server-…
imranq2 May 4, 2026
a75f80f
Add skill publish router and UI for marketplace submissions
imranq2 May 4, 2026
85744fe
Add gateway token storage auth manager with OAuth auto-registration
imranq2 May 4, 2026
7354313
Add gateway token storage auth manager with OAuth auto-registration
imranq2 May 4, 2026
449f08b
Add skill publish router with OAuth login and publish proxy
imranq2 May 4, 2026
0597504
Add skill publish router and mcp-server-gateway compose service
imranq2 May 4, 2026
a5ed114
Add docker-compose config for mcp-server-gateway service
imranq2 May 5, 2026
a032ee3
Here's a commit message for the staged changes:
imranq2 May 5, 2026
8c16c85
Add skill publish page for marketplace submissions
imranq2 May 5, 2026
c4443cf
Add MCP server plugin configuration for all-employees marketplace
imranq2 May 5, 2026
03958f2
Rename skill-creator references to bwell-skill-library
imranq2 May 5, 2026
9aa05a9
Add skill publish UI with OAuth login and gateway token storage auth …
imranq2 May 5, 2026
47f6dbb
Update language_model_gateway/gateway/auth/gateway_token_storage_auth…
imranq2 May 5, 2026
03dcaaa
Add skill publish UI with OAuth login and gateway token storage auth …
imranq2 May 5, 2026
4e0b1fa
Add McpJsonFetcher to retrieve per-plugin MCP server configs via tool…
imranq2 May 6, 2026
6836ffc
Here's the commit message for your staged changes:
imranq2 May 6, 2026
bee938b
Add CI/CD workflows and Makefile for language-model-gateway
imranq2 May 6, 2026
ed196fb
Add test fixtures and Docker Compose configs for local development
imranq2 May 6, 2026
331cc14
Add Makefile with Docker-based dev workflow and build targets
imranq2 May 6, 2026
f24716d
Here's the commit message:
imranq2 May 6, 2026
bd3b17c
Add mcp-server-gateway docker-compose and Helm services config
imranq2 May 7, 2026
3b53bba
Add skills system with MCP tool discovery and skills library server
imranq2 May 7, 2026
2824273
Add docker-compose configs for language-model-gateway and mcp-server-…
imranq2 May 7, 2026
2480edd
Add MCP server configuration for chat completions
imranq2 May 7, 2026
1a4be24
Add OIDC proxy auth provider and MCP server gateway docker-compose co…
imranq2 May 8, 2026
ac64d98
Add all-employees MCP plugin config and mcp-server-gateway docker com…
imranq2 May 8, 2026
262c37c
Add chat completion gateway with MCP auth, pass-through provider, and…
imranq2 May 9, 2026
5604921
Add MCP auth response builder, gateway token storage auth manager, an…
imranq2 May 9, 2026
6988df3
Add MCP server gateway service and all-employees plugin config
imranq2 May 11, 2026
c064443
Add unit tests for McpAuthResponseBuilder
imranq2 May 11, 2026
088b515
Add Docker Compose configs, pyproject.toml, and uv.lock
imranq2 May 11, 2026
60f3683
Here's the commit message:
imranq2 May 11, 2026
ee3f5e2
Add docker-compose config for mcp-server-gateway integration
imranq2 May 11, 2026
c7932a7
Add integration tests for chat completions with web search, scraping,…
imranq2 May 11, 2026
f0e421f
Merge pull request #159 from icanbwell/write-skill-to-github
imranq2 May 12, 2026
17ccc5e
Add LangChain chat completions provider and FastAPI app setup
imranq2 May 14, 2026
295f021
Add LanguageModelGatewayEnvironmentVariables class for centralized en…
imranq2 May 14, 2026
9dc1939
Here's the commit message:
imranq2 May 14, 2026
3444c3f
remove obsolete code
imranq2 May 14, 2026
ad9bdb5
Merge pull request #167 from icanbwell/always-add-search-tools
imranq2 May 14, 2026
d548217
Add comprehensive tests for BaileyRouter API endpoints
imranq2 May 20, 2026
b188b34
Switch MCP FHIR agent env_file from docker.env to .env
imranq2 May 20, 2026
f3361fe
Add BM25-ranked search_tools meta-discovery tool and marketplace plug…
imranq2 May 20, 2026
7275d58
Add per-environment service URLs for token exchange, ATC BFF, PSS, an…
imranq2 May 21, 2026
9e02ebe
Bump language-model-common minimum version to 2.0.43
imranq2 May 21, 2026
ea3088d
Add app login flow and all-employees MCP plugin configuration
imranq2 May 21, 2026
e2dc87f
Merge pull request #168 from icanbwell/update-mcp-fhir-agent
imranq2 May 21, 2026
ab96c62
Add Cognito staging auth provider and switch FHIR MCP to Okta
imranq2 May 22, 2026
b6180d1
Switch PSS and API Gateway URLs from client-sandbox to staging
imranq2 May 22, 2026
8c167ec
Add Bailey plugin to marketplace and remove provider-search from all-…
imranq2 May 22, 2026
5b56549
```
imranq2 May 22, 2026
bf032fd
Bump language-model-common from 2.0.44 to 2.0.46
imranq2 May 22, 2026
652ea5c
Add docker-compose.yml for local development environment
imranq2 May 22, 2026
e7fd1e4
Merge pull request #169 from icanbwell/update-mcp-fhir-agent
imranq2 May 22, 2026
bd89d30
EA-0000 update prod FHIR URL from fhir-mcp to fhir
alvinhenrick Jun 2, 2026
2ec8724
Merge pull request #171 from icanbwell/AH-EA-fhir-url-update
alvinhenrick Jun 2, 2026
60e2625
fix(security): update aiohttp from 3.13.5 to 3.14.1
aikido-autofix[bot] Jun 8, 2026
8ea6d41
Merge pull request #176 from icanbwell/fix/aikido-security-update-pac…
imranq2 Jun 9, 2026
b69550b
Bump mcp dependency from >=1.11.0 to >=1.27.2
imranq2 Jun 9, 2026
1743a2e
BAI-267 Cap fastapi <0.137 to prevent _IncludedRouter route-instrumen…
sean-can-bwell Jun 17, 2026
1d33c23
fix(security): update dependencies
aikido-autofix[bot] Jun 29, 2026
47dffee
Merge branch 'main' into upgrade-mcp-package
imranq2 Jul 1, 2026
069e296
BAI-267 Fix mypy errors after languagemodelcommon package upgrade
imranq2 Jul 1, 2026
e602fef
BAI-267 Increase Keycloak health wait timeout to match Docker healthc…
imranq2 Jul 1, 2026
de4c6d6
BAI-267 Pass ServerCardDiscovery to MCPToolProvider in container factory
imranq2 Jul 1, 2026
30b3154
BAI-267 Call init_request_context per-request before streaming
imranq2 Jul 1, 2026
4fc2e80
Merge pull request #177 from icanbwell/upgrade-mcp-package
imranq2 Jul 2, 2026
9a8da7b
Merge branch 'main' into fix/aikido-security-update-packages-57672807…
imranq2 Jul 2, 2026
7b9a85a
Merge pull request #192: Aikido security fixes
imranq2 Jul 2, 2026
c727940
BAI-290 Add CodingModelRouter for Anthropic/Bedrock proxy
imranq2 Jul 2, 2026
b9d18a3
BAI-290 Add CodingModelRouter docs and wire model-router-config.json …
imranq2 Jul 2, 2026
bdf7c9a
BAI-267 Remove FastAPI <0.137 upper bound cap now that _IncludedRoute…
imranq2 Jul 2, 2026
267adeb
BAI-290 Add zshrc setup and prod URL to CodingModelRouter client docs
imranq2 Jul 2, 2026
525ec19
Merge branch 'main' into IQ-BAI-290
imranq2 Jul 2, 2026
becf503
BAI-290 Refactor CodingModelRouter into model_routing package with Qw…
imranq2 Jul 2, 2026
7e4f2a5
BAI-290 Fix Qwen tokenizer integration and context budget enforcement
imranq2 Jul 2, 2026
10fe646
BAI-290 Update model-router docs and reduce sonnet reserved_output_to…
imranq2 Jul 2, 2026
0dac080
BAI-290 Clarify model router overview: Claude vs Bedrock tier routing
imranq2 Jul 2, 2026
7b551a9
Remove DISABLE_PROMPT_CACHING env var from router docs
imranq2 Jul 2, 2026
68777bc
BAI-290 Move model-router-config into Python package for zero-config …
imranq2 Jul 2, 2026
cf02422
Comment out local languagemodelcommon volume mount in docker-compose
imranq2 Jul 2, 2026
3f17cb0
fix: address PR #194 review comments
imranq2 Jul 3, 2026
ab7d221
feat: add ENABLE_COST_SAVINGS_INFO environment variable
imranq2 Jul 3, 2026
98728cf
BAI-290 suppress bandit B615 for HuggingFace tokenizer download
imranq2 Jul 3, 2026
74965a5
Fix PR #194 review comments
imranq2 Jul 3, 2026
4443489
BAI-290 fix ThinkingStripper to not emit content from inside think bl…
imranq2 Jul 3, 2026
8c99ed5
BAI-290 apply ruff format
imranq2 Jul 3, 2026
2aee350
BAI-290 apply ruff format to conftest and validate script
imranq2 Jul 3, 2026
55f94f4
Merge pull request #194 from icanbwell/IQ-BAI-290
imranq2 Jul 4, 2026
9d427cd
BAI-290 fix model router issues
imranq2 Jul 4, 2026
5be3584
BAI-290 improve Bedrock error logging
imranq2 Jul 4, 2026
4e8a672
BAI-290 fix stale sonnet route and improve model-routing resilience
imranq2 Jul 8, 2026
c400c65
Merge pull request #195 from icanbwell/imranq-language-model-gateway-…
imranq2 Jul 8, 2026
6dad1a1
Fix usage tracker to use x-openwebui headers for auth info
imranq2 Jul 9, 2026
b5d169b
Ruff formatting fixes
imranq2 Jul 9, 2026
ad93aa1
Replace motor with pymongo built-in async client
imranq2 Jul 10, 2026
bdb1272
Add root endpoint for ingress health checks
imranq2 Jul 10, 2026
2fd7efd
Add request_id and user_id to routing logs for better traceability
imranq2 Jul 10, 2026
4b6783a
Add tests for usage tracker header extraction and format router log call
imranq2 Jul 10, 2026
b81abb2
Address PR #198 review comments: fix usage-tracking race condition an…
imranq2 Jul 10, 2026
ca2dc8c
fix: IDOR via unvalidated user identification headers in Usage Tracking
gecko-security[bot] Jul 10, 2026
280e76c
Implement real OIDC validation for usage-tracking identity headers (f…
imranq2 Jul 10, 2026
96fddf6
Switch app logging to single-line JSON so Groundcover stops splitting…
imranq2 Jul 10, 2026
5f14a77
Record upstream latency by model tier on the request span for Groundc…
imranq2 Jul 10, 2026
254da2b
fix: IDOR enabling usage attribution spoofing in Usage Tracking
gecko-security[bot] Jul 10, 2026
78a6fce
Remove now-dead header-extraction fallback methods from UsageTracker
imranq2 Jul 10, 2026
be83087
Fix UsageTracker unit tests: don't gate record_usage on enabled twice…
imranq2 Jul 10, 2026
91449e9
Fix IDOR: stop trusting spoofable x-openwebui-user-* headers
imranq2 Jul 10, 2026
f26c202
Replace hand-rolled JsonLogFormatter with structlog's ProcessorFormatter
imranq2 Jul 10, 2026
7f61dd4
Add local-only debug request logging and clearer Bedrock Mantle error…
imranq2 Jul 11, 2026
3611cf4
Make usage-tracking Mongo writes fire-and-forget on both response paths
imranq2 Jul 12, 2026
934288f
Merge Mongo credentials into usage-tracking connection string in api.py
imranq2 Jul 12, 2026
c0cbcac
Document usage tracking, Mongo env vars, and LOG_FORMAT in router docs
imranq2 Jul 12, 2026
9eb77ab
Add MODEL_ROUTING_USAGE_COLLECTION_NAME env var
imranq2 Jul 12, 2026
5ed22a1
Default MODEL_ROUTING_USAGE_COLLECTION_NAME to model-router-usage
imranq2 Jul 12, 2026
7aad7ec
Add design spec for account_uuid to email directory lookup
imranq2 Jul 12, 2026
a47bb47
Add GZipMiddleware for compressed responses
imranq2 Jul 12, 2026
4240122
Add AccountDirectory for resolving Claude Code account_uuid to email
imranq2 Jul 12, 2026
6d7f734
Wire AccountDirectory into CodingModelRouter for usage attribution fa…
imranq2 Jul 12, 2026
49d4dc2
Add MODEL_ROUTING_ACCOUNT_DIRECTORY_COLLECTION_NAME env var
imranq2 Jul 12, 2026
3d0c896
Document account directory fallback attribution
imranq2 Jul 12, 2026
c69815c
Cache account directory lookups, fix misleading comment, drop headers…
imranq2 Jul 12, 2026
90271b0
Note the transient-failure caching tradeoff in resolve_email's docstring
imranq2 Jul 12, 2026
3686897
BAI-299 Record session_id, timestamp, and opt-in prompt/response prev…
imranq2 Jul 12, 2026
4a33e4b
BAI-299 Stop resolving email at request time, add model_tier, mark tr…
imranq2 Jul 12, 2026
ff8932d
BAI-299 Record backend, cost/savings, streaming, compression, and cus…
imranq2 Jul 12, 2026
aa845f7
BAI-299 Fix streaming-buffering bug, add disconnect handling and gate…
imranq2 Jul 13, 2026
2ef8355
BAI-299 Record request timing, per-session rollups, Anthropic-passthr…
imranq2 Jul 13, 2026
efd4b9c
Merge pull request #198 from icanbwell/fix/usage-tracker-auth-headers
imranq2 Jul 13, 2026
29ebbab
BAI-299 Capture Bedrock Mantle mid-stream error detail in model-route…
imranq2 Jul 13, 2026
6041e88
BAI-299 Fix remaining model-routing error-handling gaps from the audit
imranq2 Jul 13, 2026
0542fe1
BAI-299 Fix PR #200 review findings: correct APIError misclassificati…
imranq2 Jul 13, 2026
8ccaeba
BAI-299 Add design spec for native Bedrock transport fallback
imranq2 Jul 13, 2026
0f222cc
BAI-299 Read BEDROCK_TRANSPORT via EnvironmentVariables, not os.environ
imranq2 Jul 13, 2026
e2f1cf5
BAI-299 Capture full Bedrock Mantle response headers in model-router-…
imranq2 Jul 13, 2026
accbf52
BAI-299 Fix fallback-note loss and malformed-error passthrough in ups…
imranq2 Jul 13, 2026
f405920
BAI-299 Add implementation plan for native Bedrock transport
imranq2 Jul 14, 2026
ed64632
BAI-299 Add MODEL_ROUTING_BEDROCK_TRANSPORT toggle, unwired
imranq2 Jul 14, 2026
6058ef3
BAI-299 Add cached boto3 bedrock-runtime client for native transport
imranq2 Jul 14, 2026
7683427
BAI-299 Fix race in bedrock-runtime client cache under concurrent access
imranq2 Jul 14, 2026
8b46c18
BAI-299 Strengthen concurrency test for bedrock-runtime client cache
imranq2 Jul 14, 2026
4c7dfa5
BAI-299 Convert OpenAI-shaped requests to Bedrock Converse format
imranq2 Jul 14, 2026
6306437
BAI-299 Fix tool_choice="none" silently enabling tool use in Converse…
imranq2 Jul 14, 2026
178a7e7
BAI-299 Convert non-streaming Converse responses to Anthropic format
imranq2 Jul 14, 2026
3792e76
BAI-299 Add async adapter and SSE translator for Converse streaming
imranq2 Jul 14, 2026
fc6c753
BAI-299 Add usage-tracking wrapper for Converse streaming
imranq2 Jul 14, 2026
30ae7c6
BAI-299 Wire non-streaming native Bedrock dispatch into router.py
imranq2 Jul 14, 2026
7f69776
BAI-299 Wire streaming native Bedrock dispatch into router.py
imranq2 Jul 14, 2026
75a6604
BAI-299 Enable native Bedrock transport in local dev docker-compose
imranq2 Jul 14, 2026
b4a71c4
BAI-299 Fix native-transport mid-stream error visibility, add streami…
imranq2 Jul 14, 2026
036346a
BAI-299 Shorten tool names over Bedrock's 64-char limit in native Con…
imranq2 Jul 14, 2026
a1f6324
BAI-299 Split native Bedrock modules for SRP; fix usage-tracking gaps
imranq2 Jul 14, 2026
4e68445
BAI-299 Return cache-token usage fields for all routes, not just nati…
imranq2 Jul 14, 2026
453f058
BAI-299 Guarantee well-formed content blocks in both streaming SSE tr…
imranq2 Jul 14, 2026
91b885a
BAI-299 Document the SSE content-block well-formedness incident
imranq2 Jul 14, 2026
bd49c78
BAI-299 Default to native Bedrock transport; tag records with which t…
imranq2 Jul 14, 2026
368fe0f
BAI-299 Track retry counts, fix native-Bedrock event count, pace all …
imranq2 Jul 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion .aikido
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ rules:
exclude:
paths:
- docker-compose-openwebui.yml
- docker-compose-keycloak.yml
- docker-compose-keycloak.yml
- Makefile
- docker-compose-mcp-fhir-agent.yml
- docker-compose.yml
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
.pytest_cache
tmp
Makefile

caches
image_generation
__pycache__
language-model-gateway-configs
outputs
9 changes: 8 additions & 1 deletion docker.env.example → .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@ DATABRICKS_HOST=
DATABRICKS_SQL_WAREHOUSE_ID=
GOOGLE_CREDENTIALS_JSON=
AUTH_CLIENT_ID=
AUTH_CLIENT_SECRET=
AUTH_CLIENT_SECRET=

# Whether to run tests with real LLM
RUN_TESTS_WITH_REAL_LLM=

# mongo
PROD_MONGO_DB_PASSWORD=
CLIENT_SANDBOX_MONGO_DB_PASSWORD=
129 changes: 129 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Language Model Gateway – Copilot Code Review Instructions

## Objectives
- Keep every change aligned with the OpenAI-compatible FastAPI gateway, LangChain/LangGraph providers, and MCP bridge that back OpenWebUI and downstream agents.
- Preserve strict typing (per `setup.cfg` mypy settings), absolute imports, Ruff/formatting/security hooks, and Pipenv lock integrity.
- Guard OAuth/OIDC, AWS credentials, and user content flowing through RequestScopeMiddleware, TokenStorageAuthManager, and MCP tool traffic; never leak tokens or PII.
- Maintain the Docker Compose + Makefile workflows that spin up Keycloak, Mongo, OpenWebUI, optional MCP stacks, and observability services.
- Deliver prioritized, actionable PR feedback that makes it easy for contributors to fix blocking issues first.

## Repository Context Summary
- Stack: Python 3.12, FastAPI, LangChain/LangGraph, GraphQL, Docker Compose, Keycloak (OIDC), MongoDB (token cache), PostgreSQL (OpenWebUI), AWS (S3/Bedrock via `AwsClientFactory`), httpx, OpenTelemetry, and Pipenv.
- Entry surface: `language_model_gateway/gateway/api.py` configures FastAPI, routers under `gateway/routers/`, middleware (`FastApiLoggingMiddleware`, `RequestScopeMiddleware`), static assets, and health endpoints.
- Business layers: managers in `gateway/managers/`, providers in `gateway/providers/`, converters/streaming helpers, MCP tooling (`gateway/mcp/**`), and tool implementations in `gateway/tools/`.
- DI/IoC: `LanguageModelGatewayContainerFactory.create_container()` registers services (Auth, TokenExchange, Tool/MCP providers, LangChain providers, persistence, caching) via `oidcauthlib.container.SimpleContainer`; `ContainerRegistry` + `Inject(...)` supply dependencies to routers, managers, and background jobs.
- AuthN/AuthZ: `oidcauthlib` (AuthRouter, AuthManager, TokenReader), `TokenStorageAuthManager`, `TokenExchangeManager`, `ToolAuthManager`, and `TokenReducer` cooperate to handle on-behalf-of flows, OpenWebUI headers, and tool-scoped tokens.
- Config & env: use `language_model_gateway/configs/config_reader` + `ConfigExpiringCache` and `LanguageModelGatewayEnvironmentVariables` instead of ad-hoc `os.environ` access.
- Tests live in `tests/` (unit/functional) with dockerized execution; fixture data sits in repo (see `openwebui-config`, `language-model-gateway-configs`, etc.).
- Docker Compose files control the gateway, databases, Keycloak, MCP servers, observability (`docker-compose-otel.yml`), and OpenWebUI variants.

## Code Style and Quality Rules
- Absolute imports only (e.g., `from language_model_gateway.gateway.managers.chat_completion_manager import ChatCompletionManager`). No relative imports.
- Full type annotations for functions, class attributes, TypedDicts, and literals; prefer `Annotated[...]` for FastAPI dependencies. Avoid `Any` unless unavoidable and documented.
- `make run-pre-commit` must stay green (Ruff, formatting, mypy, security checks). When touching dependencies, update both `Pipfile` and `Pipfile.lock` via the documented make targets.
- Leverage existing abstractions:
- Resolve services via `Inject(...)`/`Depends(...)` backed by `LanguageModelGatewayContainerFactory`; never instantiate managers/providers manually in routers or tools.
- Reuse `LanguageModelGatewayEnvironmentVariables`, `ConfigReader`, `TokenReducer`, `LangGraphStreamingManager`, and `ModelFactory` rather than re-reading env vars or duplicating config parsing.
- MCP tooling: new remote tools must be registered through `MCPToolProvider`, include tracing/truncation interceptors, and respect `ToolAuthManager` token requirements. Local LangChain tools belong under `gateway/tools/` and should inherit existing base classes when possible.
- Logging: import `SRC_LOG_LEVELS`, call `logging.getLogger(__name__)`, and use `logger.exception("<message>")` inside `except` blocks to capture stack traces. Never log Authorization headers, JWTs, S3 paths with PHI, or OpenWebUI user details.
- Observability: when adding spans, obtain a tracer via `get_tracer("language_model_gateway.<module_path>")`, reuse existing span names where possible, and avoid placing secrets/PII in span attributes.

## Review Focus Areas
1. **Security & Privacy (blocking):** Keycloak/OIDC flows, PKCE helpers, RequestScopeMiddleware, TokenStorageAuthManager, TokenExchangeManager, and MCP tool auth must remain correct. No secrets in code. HTTPS for remote calls. Auth headers must never be logged or echoed back.
2. **Architectural Consistency (blocking):** Changes must fit the FastAPI router → manager → provider layering, DI patterns, and config/cache helpers. Chat completions must flow through `ChatCompletionManager`, LangChain/LangGraph providers, and `ToolProvider`/`MCPToolProvider`. New tools must wire through the DI container.
3. **Type Safety & Linting (blocking):** Full typing, no silent ignores, mypy per `setup.cfg`, Ruff, formatting, and security hooks must pass. Keep `Annotated` dependencies accurate.
4. **Tests & Reliability (blocking):** Add/extend tests under `tests/` for new routers, managers, providers, tools, or auth flows. Ensure they run via Docker (`make tests`). Favor dependency injection and fixtures over monkey patching.
5. **Performance & Resource Use (non-blocking unless severe):** Respect `TokenReducer` strategies, streaming constraints, MCP call timeouts, and `CONFIG_CACHE_TIMEOUT_SECONDS`. Avoid redundant external calls or large payloads (S3, Jira, Confluence, GitHub, Databricks).
6. **Documentation & DX (non-blocking but encouraged):** Update `README.md`, `add_new_agent.md`, or config docs when workflows/env vars change. Provide examples for new tools or endpoints.

## Blocking Issues (Must Fix Before Merge)
- Relative imports or direct instantiation that bypasses the DI container or `Inject(...)` dependencies.
- Missing/incorrect type annotations, `Any` leaks, or mypy/Ruff/pre-commit failures.
- Skipping `AuthManager`/`TokenReader`/`TokenExchangeManager` when handling user or tool tokens, or logging/returning tokens and PII.
- New routers/managers/providers not registered through `LanguageModelGatewayContainerFactory` or not resolved via `ContainerRegistry`.
- MCP tools that omit tracing/truncation interceptors, do not obtain tokens from `ToolAuthManager`, or ignore auth requirements defined in `AgentConfig`.
- Config or env access that bypasses `LanguageModelGatewayEnvironmentVariables`/`ConfigReader`, leading to inconsistent behavior across workers.
- Tests that cannot run with `make tests` or that rely on local resources outside the Compose stack.
- Dependency updates without synchronized `Pipfile`/`Pipfile.lock` changes.
- Run `make run-pre-commit` after a change to ensure the code passes linter.
- Don't put code in __init__.py files.

## Non-Blocking Suggestions (Nice to Have)
- Refactor duplicated logic in routers/managers/providers into shared helpers.
- Expand logging granularity using `SRC_LOG_LEVELS` categories (HTTP, MCP, LLM, etc.) when it aids debugging.
- Add lightweight smoke tests or fixtures for new external integrations (e.g., Confluence, Jira, GitHub, Databricks).
- Improve LangChain/LangGraph observability (span attributes, meaningful log context) without leaking sensitive data.
- Enhance docs with diagrams or flow descriptions for complex agent/tool additions.

## Security and Privacy Guidelines
- Always validate and refresh tokens through `TokenReader`/`AuthManager`; never trust headers blindly. Use RequestScopeMiddleware for per-request context.
- For PKCE/browser flows, use `AuthRouter` (from oidcauthlib). For service-to-service flows, rely on `TokenExchangeManager` and `ToolAuthManager` with least-privilege scopes.
- When bridging to AWS (Bedrock, S3), honor `AWS_CREDENTIALS_PROFILE`, use `AwsClientFactory`, and never hardcode credentials.
- Sanitize data returned from Jira, Confluence, Databricks, GitHub, or MCP servers before logging or exposing to clients. Strip PHI/PII and redact secrets.
- Use HTTPS endpoints for remote services and verify certificates (see `make create-certs` for local TLS). Do not downgrade to HTTP except for the documented local dev hosts.
- Ensure cached tokens (`ConfigExpiringCache`, Mongo, persistence) honor TTLs and are invalidated on logout/refresh endpoints.

## Performance Guidelines
- Use `TokenReducer` strategies (`TOKEN_TRUNCATION_STRATEGY`) for large model inputs/outputs. Avoid manual truncation that conflicts with the configured strategy.
- Prefer streaming via `LangGraphStreamingManager` when responses may be large; fall back to buffered responses only when necessary.
- Reuse HTTP clients from `HttpClientFactory`/`LoggingTransport` and respect timeouts defined in `LanguageModelGatewayEnvironmentVariables`.
- Batched config reads should go through `ConfigReader` with caching, rather than re-reading YAML/GraphQL files per request.
- Be mindful of MCP tool fan-out; set appropriate tool lists/timeouts in `AgentConfig` to avoid thrashing remote servers.

## Testing Guidelines
- Run `make tests` (dockerized pytest) before submitting. Use `make tests-integration` when real LLM or external integrations are required (guard with env vars such as `RUN_TESTS_WITH_REAL_LLM`).
- Favor dependency injection and fixtures over monkey patching; leverage `oidcauthlib` container overrides or helper factories for mocks.
- Use `respx`/`httpx.MockTransport` for HTTP mocking, and provide deterministic data for GitHub/Jira/Confluence/Databricks helpers.
- Cover new FastAPI routes with request/response tests (can use `TestClient` inside dockerized pytest). Include negative cases for auth failures and token refresh paths.
- When adding MCP tools or interceptors, include async tests using the existing LangChain MCP adapters and stubbed servers where feasible.

## Dependencies and Build
- Pipenv is the source of truth. Update dependencies via `make Pipfile.lock`/`make update`, commit both `Pipfile` and `Pipfile.lock`, and rebuild containers if base images change.
- Use the provided Make targets: `make devsetup`, `make build`, `make up`, `make down`, `make up-open-webui`, `make up-open-webui-auth`, `make up-mcp-server-gateway`, etc. Never hand-edit Compose-managed resources without updating the relevant YAML.
- Pre-commit hooks live in `pre-commit-hook`; run `make setup-pre-commit` before committing and ensure `make run-pre-commit` passes locally and in CI.
- For images pulled from ECR (e.g., MCP server gateway), authenticate via `aws sso login` + `aws ecr get-login-password` as documented in `README.md`.

## Documentation and Examples
- Update `README.md`, `add_new_agent.md`, `openwebui-config/functions/readme.md`, or related docs whenever you add env vars, Make targets, OAuth steps, or tool workflows.
- Provide docstrings for routers, managers, tools, and MCP interceptors describing expected inputs/outputs and auth assumptions.
- When adding MCP agents or LangChain tools, include usage guidance (sample payloads, OpenWebUI instructions, or GraphQL queries) right in the docstrings plus any relevant docs folder.
- Keep `.env.example` synchronized with new environment variables and describe whether they are required or optional.

## Integration Points
- **OpenAI-compatible APIs:** `/api/v1/chat/completions`, `/api/v1/responses`, `/api/v1/images/*`, `/models`, `/refresh`, plus legacy `/graphql`. Ensure responses match OpenAI schemas in `gateway/schema/openai`.
- **Auth:** `/auth/*` routes from `AuthRouter`, PKCE login via `/auth/login`, refresh via `/refresh`, and OpenWebUI headers (`x-openwebui-user-*`).
- **OpenWebUI:** `make up-open-webui` (no auth) or `make up-open-webui-auth` (Keycloak/OIDC + SSL). Requires `/etc/hosts` entry for `keycloak` and certificates from `make create-certs`.
- **MCP:** Remote tools fetched through `MCPToolProvider` + LangChain MCP adapters; additional MCP stacks available via `docker-compose-mcp-*.yml` and `make up-mcp-*` targets.
- **External services:** AWS (Bedrock, S3), Jira/Confluence, GitHub, Databricks, ScrapingBee, Google Search. All integrations must go through the respective helper/factory to inherit auth, logging, and retry policies.

## Quick Start and Common Commands
- Initial setup: copy `.env.example` → `.env`, set `AWS_CREDENTIALS_PROFILE`, then run:
```sh
make devsetup
```
- Bring the core stack up/down:
```sh
make down
make up
```
- Launch OpenWebUI variants:
```sh
make up-open-webui # no auth
make up-open-webui-auth # Keycloak + SSL + observability
```
- Run quality gates:
```sh
make run-pre-commit
make tests
```
- When working with MCP add-ons or observability: `make up-mcp-server-gateway`, `make up-mcp-fhir-agent`, `make up-mcp-inspector`, `make up-open-webui-ssl`, `make up-open-webui-auth` (also brings up Jaeger/otel).

## Enforcement Checklist for Reviewers
- Imports are absolute and modules resolve via the DI container; no manual singletons.
- Functions/classes are fully typed, and mypy/Ruff/pre-commit pass.
- Auth flows use `AuthManager`, `TokenReader`, `TokenExchangeManager`, and `ToolAuthManager` correctly; no secrets/PII in logs, spans, or responses.
- FastAPI routers call managers/providers rather than duplicating business logic; new services are registered in `LanguageModelGatewayContainerFactory`.
- MCP/LangChain tools honor tracing + truncation interceptors, token requirements, and config-driven URLs/timeouts.
- Tests cover new behavior and run with `make tests`; no reliance on undeclared local services.
- Docs/env samples updated for new endpoints, env vars, or workflows.
- Docker/Make targets remain usable; Compose files stay in sync with textual instructions.
15 changes: 10 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ on:
pull_request:
branches: [ main ]

# Prevent duplicate runs on the same ref and cancel in-progress on PR updates to save CI minutes
concurrency:
group: build-and-test-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build_and_test:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
# Checks-out your repository
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'

Expand All @@ -29,9 +34,9 @@ jobs:
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2

- name: create docker.env
- name: create .env
run: |
touch ${{ github.workspace }}/docker.env
touch ${{ github.workspace }}/.env

- name: pre-commit
run: make run-pre-commit && make clean-pre-commit
Expand Down Expand Up @@ -59,7 +64,7 @@ jobs:
docker compose run --rm --name language_model_gateway_tests -v ${{ github.workspace }}/reports:/reports language-model-gateway pytest . --tb=auto --junitxml=/reports/test-results.xml

- name: Upload pytest test results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: pytest-results
path: ${{ github.workspace }}/reports/**/*.xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
runs-on: main
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Checkout icanbwell/cie.gha-deploy
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: refs/tags/v0.0.33
Expand Down
Loading
Loading