How AionUi Integrates with AWS Bedrock and Cloud Providers via Custom API Endpoints

AionUi abstracts every LLM provider behind a platform-type system that routes AWS Bedrock calls through the AWS SDK with temporary credential injection while treating custom endpoints as OpenAI-compatible APIs using dynamic base URL configuration.

AionUi provides a unified interface for connecting to various large language model providers. The application integrates with AWS Bedrock and other cloud providers via custom API endpoints through a flexible architecture that normalizes provider-specific logic into a consistent model selection interface.

Platform Abstraction Architecture in AionUi

AionUi categorizes every LLM provider using a platform-type identifier such as bedrock, custom, or new-api. The model bridge located at src/process/bridge/modelBridge.ts serves as the central routing layer that resolves these platform types into concrete implementation logic. This architecture allows the UI to present a uniform model selection dropdown regardless of whether the backend communicates with AWS Bedrock or a self-hosted OpenAI-compatible server.

AWS Bedrock Integration Implementation

Credential Management and SDK Initialization

When users select the AWS Bedrock platform, the model bridge initializes the @aws-sdk/client-bedrock client. The system temporarily injects user-supplied AWS credentials into the process environment to authenticate requests without persisting sensitive data to disk. This implementation appears in src/process/bridge/modelBridge.ts between lines 161-173 and 186-212.

Inference Profile Retrieval and Model Mapping

The bridge executes ListInferenceProfilesCommand to retrieve available inference profiles from AWS Bedrock. It filters the results for Claude models and maps technical identifiers to friendly display names using the BEDROCK_MODEL_NAMES constant. The normalized output returns to the UI as an array of { id, name } objects, populating the model selection interface with human-readable options.

Connection Testing with BedrockContentGenerator

Before establishing full sessions, AionUi verifies Bedrock credentials through a lightweight validation call. The BedrockContentGenerator class, defined in src/process/bridge/bedrockBridge.ts (lines 12-62), performs a "count-tokens" operation that confirms authentication without consuming inference quota. This method provides immediate feedback in the settings interface when users test their AWS configuration.

Custom API Endpoint Integration

OpenAI-Compatible API Support

For providers not explicitly predefined, AionUi supports custom platform types that accept user-defined API endpoints. When the platform value equals custom, the system treats the endpoint as OpenAI-compatible. The model bridge constructs an OpenAI SDK instance using the user-provided base_url and api_key, then calls openai.models.list() to retrieve available models. This logic appears in src/process/bridge/modelBridge.ts at lines 87-99 and 131-149.

New-API Gateway Compatibility

AionUi extends custom endpoint support to new-api gateways that expose standard /v1/models paths. The utility function isNewApiPlatform in src/common/utils/platformConstants.ts identifies these gateway types, allowing the model bridge to apply the same OpenAI-compatible retrieval logic while handling subtle differences in response formatting. This ensures compatibility with popular open-source API gateways like LiteLLM and OneAPI.

Dynamic Base URL Configuration

Unlike predefined platforms with static endpoints, custom integrations require runtime URL configuration. The UI prompts users to input their endpoint address when selecting the custom platform type. The model bridge validates this input and incorporates it as the baseUrl parameter for SDK initialization, enabling connections to private cloud deployments, VPC endpoints, or regional API mirrors without code modifications.

Platform Configuration Registry

All supported platforms, including AWS Bedrock and custom endpoints, are declared in src/renderer/config/modelPlatforms.ts. This configuration file defines the Bedrock entry at lines 86-89, specifying required fields such as region and authentication method. The custom option appears at lines 75-78, marked with a flag indicating that it requires user-entered base URL configuration. This centralized registry allows the renderer process to dynamically generate settings forms based on platform metadata.

Code Examples

The following examples demonstrate how AionUi's IPC bridge exposes these integrations to the renderer process.

Fetch model list for a custom OpenAI-compatible provider:

await ipcBridge.mode.fetchModelList.provider({
  base_url: 'https://api.custom-provider.com/v1',
  api_key: 'sk-custom-key',
  platform: 'custom',
});

Test AWS Bedrock credentials before saving settings:

await ipcBridge.bedrock.testConnection.provider({
  bedrockConfig: {
    region: 'us-east-1',
    authMethod: 'profile',
    profile: 'my-aws-profile',
  },
});

Summary

  • AionUi uses a platform-type abstraction in src/process/bridge/modelBridge.ts to normalize interactions with AWS Bedrock and custom API endpoints.
  • AWS Bedrock integration leverages the AWS SDK with temporary credential injection, inference profile retrieval, and the BedrockContentGenerator for connection testing.
  • Custom endpoints are treated as OpenAI-compatible APIs, supporting dynamic base URL configuration and new-api gateways through the isNewApiPlatform utility.
  • Platform definitions in src/renderer/config/modelPlatforms.ts centralize configuration for both built-in and custom providers.

Frequently Asked Questions

How does AionUi handle AWS credential security when connecting to Bedrock?

AionUi temporarily injects AWS credentials into the process environment only during the active SDK call, then clears them immediately after the operation completes. This approach prevents persistent storage of sensitive keys in memory or on disk while still allowing the @aws-sdk/client-bedrock client to authenticate with AWS services.

Can AionUi connect to private LLM deployments or VPC endpoints?

Yes, the custom platform type supports arbitrary base URLs, allowing connections to private cloud deployments, VPC endpoints, or regional API mirrors. Users simply enter their endpoint address in the UI, and the model bridge initializes the OpenAI SDK with the provided base_url parameter.

What is the difference between the "custom" and "new-api" platform types in AionUi?

The custom platform type is a generic category for user-defined OpenAI-compatible endpoints, while new-api specifically identifies gateways that follow the standard /v1/models path structure used by popular open-source proxies like LiteLLM. The isNewApiPlatform utility in src/common/utils/platformConstants.ts distinguishes these cases to handle subtle response formatting differences.

How can I verify my AWS Bedrock configuration before using it in AionUi?

Use the connection test feature available in the settings interface, which calls ipcBridge.bedrock.testConnection.provider() with your configuration. This executes a lightweight token-counting operation through the BedrockContentGenerator class in src/process/bridge/bedrockBridge.ts to verify credentials without consuming inference quota.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →