2025-11-15 13:36:42 +09:00
|
|
|
# AI Provider Configuration
|
|
|
|
|
# AI_PROVIDER: Which provider to use
|
2026-06-15 12:54:18 +08:00
|
|
|
# Options: bedrock, openai, anthropic, google, vertexai, azure, ollama, openrouter, aihubmix, deepseek, siliconflow, gateway, novita
|
2025-11-15 13:36:42 +09:00
|
|
|
# Default: bedrock
|
|
|
|
|
AI_PROVIDER=bedrock
|
|
|
|
|
|
|
|
|
|
# AI_MODEL: The model ID for your chosen provider (REQUIRED)
|
2026-06-15 14:27:55 +09:00
|
|
|
# Tip: For a single-provider quick multi-model setup, list comma-separated model IDs.
|
|
|
|
|
# The first one becomes the default and the rest appear in the model picker.
|
|
|
|
|
# For multiple providers or custom apiKeyEnv/baseUrlEnv, use AI_MODELS_CONFIG / ai-models.json instead.
|
|
|
|
|
# Example: AI_MODEL=doubao-seed-1-8-251215,doubao-seed-1-6-flash,doubao-seed-1-6-pro
|
2025-11-15 13:36:42 +09:00
|
|
|
AI_MODEL=global.anthropic.claude-sonnet-4-5-20250929-v1:0
|
|
|
|
|
|
fix: raise the output budget so reasoning models reach the tool call
A reasoning model spends the output budget in order: thinking first, then prose,
then the tool call. With 16000 the thinking alone can consume all of it, so the
turn ends with finishReason "length" before display_diagram is ever called. The
canvas stays empty and nothing surfaces in the UI, because no tool call means no
tool error, and the client never reads finishReason.
Measured on openrouter deepseek/deepseek-v4-flash, the model from the report:
- max_tokens=800 with reasoning on returns reasoning_tokens=800, empty content,
finish_reason length. So reasoning is billed against this budget, not exempt.
- refining an existing diagram (19k chars of XML in the input) produced 49142
chars of reasoning, zero tool calls, finishReason "length" at 16000
- the same request at 40000 finished and called edit_diagram with 12 operations
64000 cannot just be sent to every model: bedrock claude-3-haiku caps at 4096,
nova-lite at 10000, and the openrouter deepseek-r1 endpoint counts input and
output against one 64000 ceiling. All three name the real limit in the 400, so
parse it and retry once. Verified: nova-lite logs "64000 rejected, retrying with
10000" and then completes its tool call.
Also expose the budget in Settings. It is sent as a header rather than read from
env only, so desktop users can raise it themselves without an env file.
vercel.json goes back to the 300s it had before #238 traded it for $2-4/month.
That is now Vercel's own default, and billing pauses while the function waits on
the model, so the saving that motivated 120s no longer applies. edgeone.json is
left alone: its 120 may be that platform's actual ceiling.
2026-08-22 11:45:09 +09:00
|
|
|
# Output limit, all providers (default: 64000). Shared by reasoning and the diagram XML,
|
|
|
|
|
# so a thinking model can spend it all before the tool call. Users can override it in Settings.
|
|
|
|
|
# If a model's own ceiling is lower, the request is retried with that ceiling automatically.
|
|
|
|
|
# MAX_OUTPUT_TOKENS=64000
|
2026-08-10 17:07:30 +09:00
|
|
|
|
2025-11-15 13:36:42 +09:00
|
|
|
# AWS Bedrock Configuration
|
|
|
|
|
# AWS_REGION=us-east-1
|
|
|
|
|
# AWS_ACCESS_KEY_ID=your-access-key-id
|
|
|
|
|
# AWS_SECRET_ACCESS_KEY=your-secret-access-key
|
2025-12-10 20:54:43 +05:30
|
|
|
# Note: Claude and Nova models support reasoning/extended thinking
|
|
|
|
|
# BEDROCK_REASONING_BUDGET_TOKENS=12000 # Optional: Claude reasoning budget in tokens (1024-64000)
|
|
|
|
|
# BEDROCK_REASONING_EFFORT=medium # Optional: Nova reasoning effort (low/medium/high)
|
2025-11-15 13:36:42 +09:00
|
|
|
|
|
|
|
|
# OpenAI Configuration
|
|
|
|
|
# OPENAI_API_KEY=sk-...
|
2025-11-21 16:58:42 +08:00
|
|
|
# OPENAI_BASE_URL=https://api.openai.com/v1 # Optional: Custom OpenAI-compatible endpoint
|
2025-11-15 13:36:42 +09:00
|
|
|
# OPENAI_ORGANIZATION=org-... # Optional
|
|
|
|
|
# OPENAI_PROJECT=proj_... # Optional
|
2025-12-10 20:54:43 +05:30
|
|
|
# Note: o1/o3/gpt-5 models automatically enable reasoning summary (default: detailed)
|
|
|
|
|
# OPENAI_REASONING_EFFORT=low # Optional: Reasoning effort (minimal/low/medium/high) - for o1/o3/gpt-5
|
|
|
|
|
# OPENAI_REASONING_SUMMARY=detailed # Optional: Override reasoning summary (none/brief/detailed)
|
2025-11-15 13:36:42 +09:00
|
|
|
|
|
|
|
|
# Anthropic (Direct) Configuration
|
2026-06-02 18:26:27 +08:00
|
|
|
# ANTHROPIC_API_KEY=sk-ant-... # Sent as `x-api-key` header
|
|
|
|
|
# ANTHROPIC_AUTH_TOKEN= # Alternative to ANTHROPIC_API_KEY; sent as `Authorization: Bearer` header (mutually exclusive)
|
2025-12-02 00:08:06 +08:00
|
|
|
# ANTHROPIC_BASE_URL=https://your-custom-anthropic/v1
|
2025-12-10 20:54:43 +05:30
|
|
|
# ANTHROPIC_THINKING_TYPE=enabled # Optional: Anthropic extended thinking (enabled)
|
|
|
|
|
# ANTHROPIC_THINKING_BUDGET_TOKENS=12000 # Optional: Budget for extended thinking in tokens
|
2025-11-15 13:36:42 +09:00
|
|
|
|
|
|
|
|
# Google Generative AI Configuration
|
|
|
|
|
# GOOGLE_GENERATIVE_AI_API_KEY=...
|
2025-12-02 00:08:06 +08:00
|
|
|
# GOOGLE_BASE_URL=https://generativelanguage.googleapis.com/v1beta # Optional: Custom endpoint
|
2025-12-10 20:54:43 +05:30
|
|
|
# GOOGLE_CANDIDATE_COUNT=1 # Optional: Number of candidates to generate
|
|
|
|
|
# GOOGLE_TOP_K=40 # Optional: Top K sampling parameter
|
|
|
|
|
# GOOGLE_TOP_P=0.95 # Optional: Nucleus sampling parameter
|
|
|
|
|
# Note: Gemini 2.5/3 models automatically enable reasoning display (includeThoughts: true)
|
|
|
|
|
# GOOGLE_THINKING_BUDGET=8192 # Optional: Gemini 2.5 thinking budget in tokens (for more/less thinking)
|
2026-01-11 01:39:41 -05:00
|
|
|
# GOOGLE_THINKING_LEVEL=high # Optional: Gemini 3 thinking level (low/high)
|
2026-01-11 00:11:30 -05:00
|
|
|
|
|
|
|
|
# Google Vertex AI Configuration (Enterprise GCP)
|
|
|
|
|
# For enterprise users needing data residency, VPC Service Controls, or GCP integration
|
2026-01-14 03:25:34 -05:00
|
|
|
# GOOGLE_VERTEX_API_KEY= # Required: Express Mode API key
|
|
|
|
|
# GOOGLE_VERTEX_BASE_URL=https://... # Optional: Custom endpoint URL
|
|
|
|
|
# Note: Gemini 2.5/3 models automatically enable reasoning display (includeThoughts: true)
|
2026-01-11 00:11:30 -05:00
|
|
|
# GOOGLE_VERTEX_THINKING_BUDGET=8192 # Optional: Gemini 2.5 thinking budget in tokens (1024-100000)
|
2026-01-14 03:25:34 -05:00
|
|
|
# GOOGLE_VERTEX_THINKING_LEVEL=high # Optional: Gemini 3 thinking level (minimal/low/medium/high)
|
2025-11-15 13:36:42 +09:00
|
|
|
|
|
|
|
|
# Azure OpenAI Configuration
|
2025-12-11 13:32:33 +09:00
|
|
|
# Configure endpoint using ONE of these methods:
|
|
|
|
|
# 1. AZURE_RESOURCE_NAME - SDK constructs: https://{name}.openai.azure.com/openai/v1{path}
|
|
|
|
|
# 2. AZURE_BASE_URL - SDK appends /v1{path} to your URL
|
|
|
|
|
# If both are set, AZURE_BASE_URL takes precedence.
|
2025-11-15 13:36:42 +09:00
|
|
|
# AZURE_RESOURCE_NAME=your-resource-name
|
|
|
|
|
# AZURE_API_KEY=...
|
2025-12-11 13:32:33 +09:00
|
|
|
# AZURE_BASE_URL=https://your-resource.openai.azure.com/openai # Alternative: Custom endpoint
|
2025-12-10 20:54:43 +05:30
|
|
|
# AZURE_REASONING_EFFORT=low # Optional: Azure reasoning effort (low, medium, high)
|
|
|
|
|
# AZURE_REASONING_SUMMARY=detailed
|
2025-11-15 13:36:42 +09:00
|
|
|
|
2026-02-26 13:55:21 +01:00
|
|
|
# Ollama Configuration (Local or Cloud)
|
|
|
|
|
# OLLAMA_BASE_URL=https://ollama.com/api # Optional, defaults to Ollama Cloud
|
|
|
|
|
# OLLAMA_API_KEY=your-ollama-cloud-api-key # Optional: For Ollama Cloud or authenticated remote instances
|
2025-12-10 20:54:43 +05:30
|
|
|
# OLLAMA_ENABLE_THINKING=true # Optional: Enable thinking for models that support it (e.g., qwen3)
|
2025-11-15 13:36:42 +09:00
|
|
|
|
2025-11-15 14:29:18 +09:00
|
|
|
# OpenRouter Configuration
|
|
|
|
|
# OPENROUTER_API_KEY=sk-or-v1-...
|
2025-12-02 00:08:06 +08:00
|
|
|
# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1 # Optional: Custom endpoint
|
2025-12-02 11:52:09 +09:00
|
|
|
|
2026-06-15 12:54:18 +08:00
|
|
|
# AIHubMix Configuration
|
|
|
|
|
# AIHUBMIX_API_KEY=your-aihubmix-api-key
|
|
|
|
|
# AIHUBMIX_BASE_URL=https://aihubmix.com/v1 # Optional: Custom endpoint
|
|
|
|
|
|
2025-12-02 11:52:09 +09:00
|
|
|
# DeepSeek Configuration
|
|
|
|
|
# DEEPSEEK_API_KEY=sk-...
|
|
|
|
|
# DEEPSEEK_BASE_URL=https://api.deepseek.com/v1 # Optional: Custom endpoint
|
2025-12-05 21:15:02 +09:00
|
|
|
|
2025-12-07 09:22:57 +08:00
|
|
|
# SiliconFlow Configuration (OpenAI-compatible)
|
|
|
|
|
# Base domain can be .com or .cn, defaults to https://api.siliconflow.com/v1
|
|
|
|
|
# SILICONFLOW_API_KEY=sk-...
|
|
|
|
|
# SILICONFLOW_BASE_URL=https://api.siliconflow.com/v1 # Optional: switch to https://api.siliconflow.cn/v1 if needed
|
|
|
|
|
|
2025-12-22 22:13:45 +08:00
|
|
|
# SGLang Configuration (OpenAI-compatible)
|
|
|
|
|
# SGLANG_API_KEY=your-sglang-api-key
|
|
|
|
|
# SGLANG_BASE_URL=http://127.0.0.1:8000/v1 # Your SGLang endpoint
|
|
|
|
|
|
2026-01-06 18:41:25 +08:00
|
|
|
# ModelScope Configuration
|
|
|
|
|
# MODELSCOPE_API_KEY=ms-...
|
|
|
|
|
# MODELSCOPE_BASE_URL=https://api-inference.modelscope.cn/v1 # Optional: Custom endpoint
|
|
|
|
|
|
2025-12-29 11:30:58 +09:00
|
|
|
# ByteDance Doubao Configuration (via Volcengine)
|
|
|
|
|
# DOUBAO_API_KEY=your-doubao-api-key
|
|
|
|
|
# DOUBAO_BASE_URL=https://ark.cn-beijing.volces.com/api/v3 # ByteDance Volcengine endpoint
|
|
|
|
|
|
2025-12-16 22:43:33 -05:00
|
|
|
# Vercel AI Gateway Configuration
|
|
|
|
|
# Get your API key from: https://vercel.com/ai-gateway
|
|
|
|
|
# Model format: "provider/model" e.g., "openai/gpt-4o", "anthropic/claude-sonnet-4-5"
|
|
|
|
|
# AI_GATEWAY_API_KEY=...
|
2025-12-18 21:00:21 +08:00
|
|
|
# AI_GATEWAY_BASE_URL=https://your-custom-gateway.com/v1/ai # Optional: Custom Gateway URL (for local dev or self-hosted Gateway)
|
|
|
|
|
# # If not set, uses Vercel default: https://ai-gateway.vercel.sh/v1/ai
|
2025-12-16 22:43:33 -05:00
|
|
|
|
2025-12-05 21:15:02 +09:00
|
|
|
# Langfuse Observability (Optional)
|
|
|
|
|
# Enable LLM tracing and analytics - https://langfuse.com
|
|
|
|
|
# LANGFUSE_PUBLIC_KEY=pk-lf-...
|
|
|
|
|
# LANGFUSE_SECRET_KEY=sk-lf-...
|
|
|
|
|
# LANGFUSE_BASEURL=https://cloud.langfuse.com # EU region, use https://us.cloud.langfuse.com for US
|
2025-12-05 21:09:34 +08:00
|
|
|
|
2026-01-15 21:28:22 +05:30
|
|
|
# Optional server-side multi-model configuration
|
|
|
|
|
# If set, points to a JSON file with server-provided models (see README for schema).
|
|
|
|
|
# Default: ./ai-models.json in project root
|
|
|
|
|
# AI_MODELS_CONFIG_PATH=/path/to/ai-models.json
|
|
|
|
|
|
2025-12-06 22:04:59 +05:30
|
|
|
# Temperature (Optional)
|
|
|
|
|
# Controls randomness in AI responses. Lower = more deterministic.
|
|
|
|
|
# Leave unset for models that don't support temperature (e.g., GPT-5.1 reasoning models)
|
|
|
|
|
# TEMPERATURE=0
|
|
|
|
|
|
2025-12-05 21:09:34 +08:00
|
|
|
# Access Control (Optional)
|
|
|
|
|
# ACCESS_CODE_LIST=your-secret-code,another-code
|
2025-12-09 22:00:54 +09:00
|
|
|
|
feat: add file-based admin settings panel at /admin (#866)
* feat: add file-based admin settings panel at /admin
Settings saved in the panel are written to data/settings.json and
overlaid onto process.env, taking precedence over environment
variables and applying immediately without restart. Enable by setting
ADMIN_PASSWORD; on serverless platforms without persistent disk the
panel degrades to read-only.
* polish: admin panel UI improvements
- Provider logos in credential rows (shared ProviderLogo component,
extracted from model-config-dialog)
- Scroll-spy active state in the sidebar nav
- Green success state in the save bar that clears after a few seconds
- Wider content column (max-w-6xl) for less wasted space on desktop
* polish: admin panel section toggles and reorder
- Move Quota & Rate Limits to the end of the settings page
- Add enable switches to Observability and Quota sections; default off
with fields grayed out, auto-on when any field is already configured
* polish: make section enable switch more visible
Wrap the switch in a labeled pill ('Enabled'/'Disabled') with border
and background so the off state is clearly visible.
* refactor: derive admin registry from PROVIDER_INFO, simplify page state
- Provider options, labels, and base-URL placeholders now come from
PROVIDER_INFO instead of hand-copied lists (fixes SiliconFlow .com/.cn
placeholder drift; panel names now match the model-config dialog)
- Replace free-text subgroup strings + SUBGROUP_PROVIDERS reverse map
with a typed provider field on SettingDef
- Precompute SETTINGS_BY_GROUP and PROVIDER_SUBGROUPS at module level
- Merge justSaved into saveMessage, drop unused mainRef, hoist
fetchSettings out of the component, dedupe savedText logic
- Serialize from SETTINGS_REGISTRY directly; json validators in a map
instead of a hardcoded key check
- Make allowPrivateUrls a function so ALLOW_PRIVATE_URLS edits in the
admin panel apply without restart
* feat: graphical model management in admin panel
Replace the provider credential fields and raw AI_MODELS_CONFIG JSON
textarea with a Models section mirroring the in-app model settings UI:
provider instance list with logos, credential fields per provider type,
model add/remove with suggestions, per-model connectivity test, and a
default-provider star.
On save the server derives everything the runtime needs into
settings.json: credential env vars (with _2 suffixes for multiple
instances of one provider), AI_MODELS_CONFIG, and AI_PROVIDER/AI_MODEL
for the default. Secrets round-trip as masked markers and are never
sent back to the browser. The general settings registry now only
covers non-provider settings (generation, access, features,
observability, quota).
* fix: allow testing unsaved providers in admin panel
The test button previously looked up credentials by providerId in the
saved settings, so testing a newly added (unsaved) provider failed with
'Unknown provider or model'. The test endpoint now accepts the client's
current provider state; newly typed secrets are used as-is and masked
markers are resolved against the stored values, so testing works both
before and after saving.
* fix: merge env AI_MODELS_CONFIG with admin panel providers
Previously, saving in the admin panel wrote a complete AI_MODELS_CONFIG
into settings.json, which (by overlay precedence) replaced any config
from .env or ai-models.json — admins lost their env-configured models.
The panel no longer writes AI_MODELS_CONFIG. Instead its providers are
merged with the env baseline at read time in loadRawServerModelsConfig,
and panel credentials go to ADMIN_-prefixed env vars wired up via
apiKeyEnv/baseUrlEnv so they never shadow standard vars. Env-based
providers now appear read-only in the panel, name clashes are rejected,
and a panel default overrides the env default. data/ is now gitignored.
* fix: block global-credential providers already managed via env
Bedrock, Vertex AI, and Ollama credentials live in fixed env vars with
no apiKeyEnv redirection, so a panel instance of one of these would
silently override the credentials that env-configured models rely on.
The API now rejects saving such a provider when the env config already
uses that type, and the Add Provider dropdown disables it with a
'managed via env' note.
* fix: address admin panel review findings
- Security: test-model no longer resolves a stored secret when the
request's baseUrl/provider differs from the stored entry, closing a
path where a tampered baseUrl could exfiltrate a saved key
- Save failures are now visible: the save bar shows the error in red
(was masked by the persistent 'Unsaved changes' text), and per-field
validation errors from the settings API are surfaced under each field
- The Observability/Quota enable switch is now real: toggling off stages
deletion of the group's saved values, and the toggle no longer snaps
back to Enabled after saving
- Env provider's default star is hidden when a panel provider is the
active default (no more double star)
- Clearing a credential field reverts to the stored value instead of
silently deleting it; an explicit X button removes a stored secret
- Form inputs are disabled during an in-flight save
* refactor(admin): split 1549-line admin page into focused modules
Extract admin-shared.ts (types + fetch helper), setting-field.tsx
(registry-driven fields), and models-section.tsx (provider/model
manager) from page.tsx. Pure mechanical move, no behavior change.
* feat(admin): share credential fields with user dialog and localize panel
Extract ProviderCredentialsFields (display name + per-provider
credential inputs) used by both the user ModelConfigDialog and the
admin Models panel; secret input passed via renderSecret (plaintext
vs masked), test button via footer slot. Add full i18n for the admin
panel across en/zh/ja/zh-Hant, reusing modelConfig.* for shared parts.
* fix(admin): address Copilot review findings
- Reflect built-in defaults for boolean settings (ALLOW_PRIVATE_URLS
defaults on) and allow clearing a saved boolean back to default,
so the SSRF toggle matches actual runtime behavior.
- Harden JSON loading: filter settings values to strings only, and
schema-validate stored ADMIN_PROVIDERS entries, dropping malformed
ones instead of letting them reach runtime code.
- Set beforeunload returnValue so the unsaved-changes prompt shows in
all browsers; reject non-finite numbers in settings validation.
- Fix README/CN/JA docs that claimed the panel auto-generates
AI_MODELS_CONFIG (providers are merged at read time, not written).
- Add unit tests for corrupted-file value filtering and provider
schema validation.
* docs: move admin panel details to dedicated docs/{en,cn,ja}/admin-panel.md
The READMEs now carry a short blurb + link, matching the existing
per-topic docs (docker.md, ai-providers.md, ...). Removes the ~22-line
inline section and the duplicated data/settings.json mentions.
* fix(admin): address follow-up Copilot findings on the prior fixes
- loadAdminProviders now validates against a stored-shape schema where
secrets are plain strings, so a hand-edited ADMIN_PROVIDERS holding an
{isSet} marker is dropped instead of later crashing maskSecret().
- loadSettings guards against array values (typeof [] === 'object'),
which would otherwise overlay numeric keys onto process.env.
- Admin SecretInput uses the bare id so the shared component's
<Label htmlFor> stays associated (only one ProviderDetail mounts).
- Add tests: marker-secret rejection, array-values guard, bedrock
multi-secret round-trip.
2026-06-15 00:40:35 +09:00
|
|
|
# Admin Panel (Optional)
|
|
|
|
|
# Set a password to enable the web admin panel at /admin, where most of the
|
|
|
|
|
# settings in this file can be edited at runtime (stored in data/settings.json,
|
|
|
|
|
# which takes precedence over environment variables).
|
|
|
|
|
# Leave unset to disable the admin panel entirely.
|
|
|
|
|
# ADMIN_PASSWORD=your-admin-password
|
|
|
|
|
# SETTINGS_FILE=./data/settings.json # Optional: custom settings file location
|
|
|
|
|
|
2025-12-09 22:00:54 +09:00
|
|
|
# Draw.io Configuration (Optional)
|
|
|
|
|
# NEXT_PUBLIC_DRAWIO_BASE_URL=https://embed.diagrams.net # Default: https://embed.diagrams.net
|
|
|
|
|
# Use this to point to a self-hosted draw.io instance
|
2025-12-10 21:32:35 +09:00
|
|
|
|
2025-12-22 19:58:55 +05:30
|
|
|
# Subdirectory Deployment (Optional)
|
|
|
|
|
# For deploying to a subdirectory (e.g., https://example.com/nextaidrawio)
|
|
|
|
|
# Set this to your subdirectory path with leading slash (e.g., /nextaidrawio)
|
|
|
|
|
# Leave empty for root deployment (default)
|
|
|
|
|
# NEXT_PUBLIC_BASE_PATH=/nextaidrawio
|
|
|
|
|
|
2025-12-10 21:32:35 +09:00
|
|
|
# PDF Input Feature (Optional)
|
|
|
|
|
# Enable PDF file upload to extract text and generate diagrams
|
|
|
|
|
# Enabled by default. Set to "false" to disable.
|
|
|
|
|
# ENABLE_PDF_INPUT=true
|
2025-12-11 14:14:31 +09:00
|
|
|
# NEXT_PUBLIC_MAX_EXTRACTED_CHARS=150000 # Max characters for PDF/text extraction (default: 150000)
|
2026-01-17 23:14:53 +09:00
|
|
|
|
|
|
|
|
# Security Settings (Optional)
|
|
|
|
|
# Allow private/internal URLs for reverse proxy setups (default: true)
|
|
|
|
|
# Set to "false" to block private IPs, localhost, and internal hostnames
|
|
|
|
|
# ALLOW_PRIVATE_URLS=false
|
2026-02-27 07:34:05 -08:00
|
|
|
|
|
|
|
|
# Self-hosted deployment (Optional)
|
|
|
|
|
# Self-hosted users may implement custom quota-management solutions,
|
|
|
|
|
# which triggers the client UI to display messages suggesting self-hosting or sponsorship.
|
|
|
|
|
# This switch allows self-hosted users to provide custom messages in response to a 429 code,
|
|
|
|
|
# in messageTokenSelfHosted, messageApiSelfHosted, and tipSelfHosted translation strings.
|
|
|
|
|
# NEXT_PUBLIC_SELFHOSTED=true
|
feat: Add support for Chinese AI providers (GLM, Qwen, Kimi, MiniMax, Qiniu)
* feat: Add support for Chinese AI providers (GLM, Qwen, Kimi, MiniMax, Qiniu)
- Add minimax, glm, qwen, qiniu, kimi to ProviderName type
- Add provider configurations to PROVIDER_INFO with default base URLs
- Add suggested models for MiniMax in SUGGESTED_MODELS
- Add minimax/glm/qwen/qiniu/kimi cases to getAIModel using OpenAI-compatible SDK
- Update ALLOWED_CLIENT_PROVIDERS and error messages
- Add environment variable examples to env.example
Fixes: MiniMax API compatibility issue (invalid chat setting 2013)
* fix: Add missing providers to PROVIDER_ENV_VARS type
* fix: Handle null case in PROVIDER_ENV_VARS for new providers
* fix: Add minimax/glm/qwen/kimi/qiniu support to validate-model API
- Add getDefaultBaseUrl helper function
- Add validation cases for new providers in validate-model route
* fix: Add new providers to buildProviderOptions switch case
* fix: Merge multiple system messages into one for minimax/glm/qwen/kimi/qiniu
MiniMax API doesn't support multiple system messages.
This fix combines them into a single message for Chinese providers.
* fix: Handle null provider in system message check
* debug: Add logging for allMessages count
* fix: Use effective provider (including env var fallback) for isSingleSystemProvider check
* fix: apply biome formatting (line-wrapping)
* docs: add Chinese AI providers documentation (MiniMax, GLM, Qwen, Kimi, Qiniu)
- Add i18n translations for new providers in all language dictionaries
- Add provider configuration documentation in en/cn/ja docs
* fix: 改进 PR #722 的代码审查反馈
1. 删除重复的 getDefaultBaseUrl 函数,改用 model-config.ts 的 PROVIDER_INFO
2. validate-model 路由改用 AI SDK 的 createOpenAI + generateText
3. 修复 resolveBaseURL 回退逻辑,传入 PROVIDER_INFO 的 defaultBaseUrl
4. 删除无用的 .bak 备份文件
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* fix: 修正中国 AI provider 端点配置
- qiniu: api.qiniucdn.com → api.qnaigc.com
- qwen: dashscope.aliyun.com → dashscope.aliyuncs.com
- 更新 env.example 文档链接
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* feat: MiniMax 使用 Anthropic 兼容 API
- MiniMax 改用 createAnthropic (而非 createOpenAI)
- 支持 api.minimax.io/anthropic 和 api.minimaxi.com/anthropic
- 合并多个 system 消息为单个 (MiniMax/GLM/Qwen/Kimi/Qiniu)
- 更新默认模型为 MiniMax-M2.5 系列
- 支持 MINIMAX_BASE_URL 环境变量配置
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* docs: 更新 MiniMax 文档
- 添加 Anthropic 兼容 API 说明
- 更新默认模型为 MiniMax-M2.5
- 添加国际版/中国大陆版配置示例
- 更新 env.example 注释
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* fix: 完善 MiniMax 双端点支持及问题修复
- 支持 MiniMax Anthropic 兼容端点和 OpenAI 兼容端点自动切换
- 修正默认端点为 api.minimaxi.com (中国大陆可用)
- 修复端点路径缺少 /v1 的问题
- 添加前端 MiniMax logo 映射
- 移除调试日志
- 修正 env.example 默认配置
* chore: clean backup artifacts and align biome formatting
* fix: resolve effectiveProvider bug, deduplicate MiniMax URL logic, fix docs
- Fix critical bug: effectiveProvider was empty during auto-detection,
causing multi-system-message to be sent to MiniMax (which rejects it).
Now uses resolved provider from getAIModel instead of re-deriving it.
- Extract normalizeMiniMaxBaseURL() shared helper to eliminate duplication
between ai-providers.ts and validate-model/route.ts
- Add guard for undefined MiniMax baseURL to prevent hitting api.anthropic.com
- Fix docs: mark China mainland URL as default (matches code behavior)
- Restructure minimax/glm/qwen/kimi/qiniu validation to use shared pattern
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: document MiniMax dual API formats in docs and UI
- Add hint below Base URL input when MiniMax is selected, explaining
Anthropic-compatible (/anthropic) vs OpenAI-compatible (/v1) endpoints
- Update all 3 ai-providers docs (en/cn/ja) to list all 4 endpoint options
(China/International × Anthropic/OpenAI)
- Add i18n translations for the hint in all 4 locales
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: deduplicate PROVIDER_LOGO_MAP, remove unnecessary optional chaining
- Extract PROVIDER_LOGO_MAP to lib/types/model-config.ts (was duplicated
in model-config-dialog.tsx and model-selector.tsx)
- Remove unnecessary ?. on PROVIDER_INFO.minimax (it's a full Record)
---------
Co-authored-by: msga-oc <msga-oc@gitea.misakiga.top>
Co-authored-by: Shinyi <shinyi@openclaw.ai>
Co-authored-by: dayuan.jiang <jdy.toh@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:53:47 +08:00
|
|
|
|
|
|
|
|
# Minimax Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://platform.minimaxi.com/docs/guides/models-intro
|
|
|
|
|
# MINIMAX_API_KEY=your_minimax_api_key
|
|
|
|
|
# MINIMAX_BASE_URL=https://api.minimaxi.com/anthropic # Optional, default (China mainland)
|
|
|
|
|
|
|
|
|
|
# GLM Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://open.bigmodel.cn/dev/api
|
|
|
|
|
# GLM_API_KEY=your_glm_api_key
|
|
|
|
|
# GLM_BASE_URL=https://open.bigmodel.cn/api/paas/v4 # Optional, default
|
|
|
|
|
|
|
|
|
|
# Qwen Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://www.aliyun.com/product/bailian
|
|
|
|
|
# QWEN_API_KEY=your_qwen_api_key
|
|
|
|
|
# QWEN_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 # Optional, default
|
|
|
|
|
|
|
|
|
|
# Kimi Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://platform.moonshot.cn/
|
|
|
|
|
# KIMI_API_KEY=your_kimi_api_key
|
|
|
|
|
# KIMI_BASE_URL=https://api.moonshot.cn/v1 # Optional, default
|
|
|
|
|
|
|
|
|
|
# Qiniu Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://www.qiniu.com/ai/models
|
|
|
|
|
# QINIU_API_KEY=your_qiniu_api_key
|
|
|
|
|
# QINIU_BASE_URL=https://api.qnaigc.com/v1 # Optional, default
|
2026-03-25 15:03:51 +08:00
|
|
|
|
|
|
|
|
# Novita AI Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://novita.ai/dashboard/key
|
|
|
|
|
# NOVITA_API_KEY=your_novita_api_key
|
|
|
|
|
# NOVITA_BASE_URL=https://api.novita.ai/openai # Optional, default
|
2026-07-12 08:10:12 +08:00
|
|
|
|
|
|
|
|
# MiMo (Xiaomi) Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://platform.xiaomimimo.com/
|
|
|
|
|
# MIMO_API_KEY=your_mimo_api_key
|
|
|
|
|
# MIMO_BASE_URL=https://api.xiaomimimo.com/v1 # Optional, default. Token Plan users: https://token-plan-cn.xiaomimimo.com/v1
|
2026-07-30 22:27:18 +08:00
|
|
|
|
|
|
|
|
# Atlas Cloud Configuration (Optional)
|
|
|
|
|
# Get your API key from: https://www.atlascloud.ai/console/api-keys
|
|
|
|
|
# ATLASCLOUD_API_KEY=your_atlascloud_api_key
|
|
|
|
|
# ATLASCLOUD_BASE_URL=https://api.atlascloud.ai/v1 # Optional, default. LLM chat endpoint; media generation uses a separate API.
|