Skip to content

LLM Configuration

VeryLiu edited this page Sep 26, 2025 · 6 revisions

โš™๏ธ AionUi LLM Configuration Tutorial

This tutorial will detail how to configure various large language models in AionUi, including Gemini, OpenAI, ModelScope, OpenRouter and other platforms, as well as advanced features like multi-API key rotation.

English | ็ฎ€ไฝ“ไธญๆ–‡

๐ŸŽฏ Configuration Overview

AionUi supports multiple LLM platforms, each with different configuration methods:

Platform Authentication Multi-Key Support Special Features
Gemini API Key / Google Login โœ… Image generation, tool calling
OpenAI API Key โœ… Function calling, image generation
ModelScope API Key โŒ Chinese optimization
OpenRouter API Key โŒ Multi-model aggregation
Custom Platform API Key โœ… OpenAI-compatible interface

๐ŸŒŸ Method 1: Google Account Login (Recommended)

Advantages

  • No API Key Required: Direct Google account login
  • Auto Update: Token automatically refreshes, no manual maintenance
  • Secure & Reliable: Uses OAuth 2.0 standard authentication
  • Complete Features: Supports all Gemini functionality

Configuration Steps

  1. Enter Gemini Settings

    • Click the "Settings" icon in the left sidebar
    • Select "Gemini Settings"
  2. Google Login

    • Click the "Google Login" button
    • Complete Google account login in the popup browser window
    • Authorize AionUi to access your Google account

Google login configuration screenshot - showing login button and authorization page

  1. Verify Login Status
    • After successful login, the interface will display your Google account information
    • You can click "Logout" button to switch accounts

Google account status screenshot - showing logged-in account info

Common Login Issues

If you encounter problems with Google login, try the following solutions:

1. Network Issues

  • VPN Setup: It's recommended to set VPN to US region
  • Proxy Configuration: Fill in proxy address in Gemini settings
  • Network Check: Ensure stable network connection and normal access to Google services

2. Cloud Project ID Issues

  • Register Project: Need to create Google Cloud Project, see detailed tutorial below

๐Ÿ“‹ Google Cloud Project ID Creation Detailed Tutorial

If you encounter Project ID issues, follow these steps to create a Google Cloud Project:

Step 1: Access Google Cloud Console

  1. Open your browser and visit Google Cloud Console
  2. Sign in with your Google account

Step 2: Create New Project

  1. At the top of the page, click the project selector (dropdown menu showing current project name)
  2. Click "New Project" button
  3. Fill in project information:
    • Project Name: Enter a descriptive name (e.g., "AionUi-Gemini-Project")
    • Organization: Select your organization (if any)
    • Location: Choose project location
  4. Click "Create" button

Step 3: Get Project ID

  1. After project creation, you can see the newly created project in the project selector
  2. Click the project name to enter the project details page
  3. In the project information card, find "Project ID" (format like: my-project-123456)
  4. Copy this Project ID

Step 4: Configure in AionUi

  1. Return to AionUi's Gemini settings page
  2. Paste the copied Project ID in the Project ID input box
  3. Click save configuration

Step 5: Enable Required APIs (Optional)

To ensure complete functionality, it's recommended to enable the following APIs:

  1. In Google Cloud Console, click "APIs & Services" > "Library" in the left menu
  2. Search and enable:
    • Generative Language API
    • AI Platform API
    • Vertex AI API

Reference Documentation: Gemini CLI Authentication Documentation


๐Ÿ”‘ Method 2: API Key Configuration

LLM configuration interface screenshot - showing model configuration and platform selection

Gemini Platform Configuration

  1. Get Gemini API Key

    • Visit Google AI Studio
    • Login with Google account
    • Create new API Key in "API Keys" page
  2. Configure in AionUi

    • Click the "Settings" icon in the left sidebar
    • Select "Model Settings"
    • Click "Add Model" button
    • Select platform: Gemini
    • Enter API Key
    • System will automatically fetch available model list

Custom Platform Configuration

  1. Get API Key

    • Visit the corresponding platform's API Key management page
    • Login to account and create new API Key
    • Copy API Key for later use
  2. Configure in AionUi

    • Select platform: Custom Platform
    • Enter corresponding Base URL
    • Enter API Key
    • Select models to use

Common Platform Base URLs:

  • OpenAI: https://api.openai.com/v1
  • Anthropic: https://api.anthropic.com/v1
  • xAI: https://api.x.ai/v1
  • DeepSeek: https://api.deepseek.com
  • Moonshot: https://api.moonshot.cn/v1
  • Zhipu: https://open.bigmodel.cn/api/paas/v4

ModelScope Platform Configuration

  1. Get ModelScope API Key

    • Visit ModelScope
    • Login with Alibaba Cloud account
    • Create access token
  2. Configure in AionUi

    • Select platform: ModelScope
    • Base URL: https://api-inference.modelscope.cn/v1
    • Enter ModelScope API Key
    • Select models (like qwen-turbo, qwen-plus, etc.)

OpenRouter Platform Configuration

  1. Get OpenRouter API Key

    • Visit OpenRouter
    • Register OpenRouter account
    • Create API Key
  2. Configure in AionUi

    • Select platform: OpenRouter
    • Base URL: https://openrouter.ai/api/v1
    • Enter OpenRouter API Key
    • Select models (supports various open-source and commercial models)

๐Ÿ”„ Multi-API Key Rotation Configuration

Feature Description

AionUi supports automatic multi-API key rotation to improve service reliability and availability:

  • Automatic Rotation: Automatically switch to next key when current key encounters errors
  • Smart Blacklist: Failed keys are temporarily blacklisted for 90 seconds
  • Error Recovery: Blacklisted keys automatically recover after expiration
  • Load Balancing: Randomly select starting key to distribute request pressure

Configuration Method

  1. Enter Multiple Keys in API Key Field

    sk-xxx1,sk-xxx2,sk-xxx3
    

    Or use line breaks:

    sk-xxx1
    sk-xxx2
    sk-xxx3
    
  2. Supported Platforms

    • โœ… Gemini: Supports multi-key rotation
    • โœ… OpenAI: Supports multi-key rotation
    • โŒ ModelScope: Not currently supported
    • โŒ OpenRouter: Not currently supported

Multi-API Key configuration screenshot - showing multiple key input format

Rotation Mechanism Details

  1. Error Detection

    • Detect errors like 401 (authentication failed), 429 (rate limit), 503 (service unavailable)
    • Automatically add current key to blacklist
  2. Automatic Switching

    • Randomly select next key from available key list
    • Update environment variables, reinitialize client
  3. Blacklist Management

    • Failed keys are blacklisted for 90 seconds
    • Blacklisted keys automatically recover after expiration
    • Avoid performance issues from frequent switching

โ“ Common Questions

Q: How to know if configuration is successful?

A: Check methods:

  • Can see configured platforms and models in model list
  • Can select configured models in conversation interface
  • Can receive normal replies when sending messages

Q: Multi-API key rotation not working?

A: Check points:

  • Ensure key format is correct (comma or line break separated)
  • Check if platform supports multi-key (currently only Gemini and OpenAI support)
  • Check console logs to understand rotation status

Q: Model list empty or loading failed?

A: Possible reasons:

  • API key invalid or expired
  • Base URL configuration error
  • Network connection issues
  • Platform service temporarily unavailable

Q: How to switch between different models?

A: Switching methods:

  • Select different models when starting a new conversation
  • Model switching during current conversation is not currently supported
  • System will remember your selection preferences

Q: Configured models not visible in conversation?

A: Check configuration:

  • Ensure model supports function_calling capability
  • Re-save configuration and restart application

๐Ÿ“š Related Documentation


Need Help?

After configuration, you can enjoy multi-platform, multi-model AI experience!

๐Ÿš€ AionUi Wiki

Welcome to the comprehensive AionUi documentation! Find everything you need to configure, use, and master AionUi.


๐Ÿ  Home


๐Ÿ“š Configuration & Usage Guides

Overview

Getting Started

Core Configuration

Support


๐ŸŽฏ Application Use Cases

Overview

Featured Use Cases


๐ŸŒ Language Switch


๐Ÿ”— Quick Links


๐Ÿค Community

Clone this wiki locally