Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions astrbot/core/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,18 @@ def get_local_permission_defaults(system: str | None = None) -> dict:
"proxy": "",
"custom_headers": {},
},
"bf16.ai": {
"id": "bf16",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Concurrent setup overwrites provider

When two dashboards with the same initially loaded provider list add and save a bf16.ai source before either refreshes, both dashboards generate bf16 from their local provider-source lists, and the later upsert_provider_source call finds that ID and replaces the stored source instead of rejecting the create. The first dashboard’s API key and settings are lost, and both users see a single provider source.

Make source creation enforce ID uniqueness atomically on the server, or generate IDs that remain unique across dashboards.

Prompt for AI agents
In `astrbot/core/config/default.py` at line 1686:

**Concurrent setup overwrites provider**

When two dashboards with the same initially loaded provider list add and save a bf16.ai source before either refreshes, both dashboards generate `bf16` from their local provider-source lists, and the later `upsert_provider_source` call finds that ID and replaces the stored source instead of rejecting the create. The first dashboard’s API key and settings are lost, and both users see a single provider source.

Make source creation enforce ID uniqueness atomically on the server, or generate IDs that remain unique across dashboards.

"provider": "bf16",
"type": "openai_chat_completion",
"provider_type": "chat_completion",
"enable": True,
"key": [],
"api_base": "https://api.bf16.ai/v1",
"timeout": 120,
"proxy": "",
"custom_headers": {},
},
"Compshare": {
"id": "compshare",
"provider": "compshare",
Expand Down
43 changes: 43 additions & 0 deletions dashboard/src/assets/images/provider_logos/bf16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions dashboard/src/utils/providerUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import mirarouterIcon from '@/assets/images/provider_logos/mirarouter.svg?no-inline';
import bf16Icon from '@/assets/images/provider_logos/bf16.svg?no-inline';

/**
* 提供商相关的工具函数
Expand All @@ -12,6 +13,7 @@ import mirarouterIcon from '@/assets/images/provider_logos/mirarouter.svg?no-inl
export function getProviderIcon(type) {
const icons = {
'mirarouter': mirarouterIcon,
'bf16': bf16Icon,
'openai': 'https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@latest/icons/openai.svg',
'azure': 'https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@latest/icons/azure.svg',
'xai': 'https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@latest/icons/xai.svg',
Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default defineConfig({
{ text: "硅基流动", link: "/siliconflow" },
{ text: "小马算力", link: "/tokenpony" },
{ text: "302.AI", link: "/302ai" },
{ text: "bf16.ai", link: "/bf16" },
{ text: "DeepSeek TTS", link: "/deepseek-tts" },
{ text: "DeepSeek STT", link: "/deepseek-stt" },
{ text: "Ollama", link: "/provider-ollama" },
Expand Down Expand Up @@ -440,6 +441,7 @@ export default defineConfig({
{ text: "SiliconFlow", link: "/siliconflow" },
{ text: "TokenPony", link: "/tokenpony" },
{ text: "302.AI", link: "/302ai" },
{ text: "bf16.ai", link: "/bf16" },
{ text: "DeepSeek TTS", link: "/deepseek-tts" },
{ text: "DeepSeek STT", link: "/deepseek-stt" },
{ text: "Ollama", link: "/provider-ollama" },
Expand Down
15 changes: 15 additions & 0 deletions docs/en/providers/bf16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Connecting to bf16.ai

[bf16.ai](https://bf16.ai) is an uncensored LLM API serving open-weight models (DeepSeek V4.1 Flash, GLM-5.3, Kimi K3.1 Pro, and bf16 Auto routers) with 1M context windows, vision, structured tool calling, and ultra-low refusal rates over an OpenAI-compatible endpoint. Because refusal behavior is removed from the model weights rather than papered over with prompts, autonomous AstrBot IM workflows and tool chains complete reliably while your local AstrBot permissions and sandboxes enforce operational boundaries.

## Configuring the Chat Model

1. Register and sign in at [bf16.ai](https://bf16.ai).
2. Create an API key (`sk-bf16-v1-...`) in [Dashboard → API Keys](https://bf16.ai/dashboard/keys).
3. In the AstrBot WebUI, open **Providers → Chat Completion**, click **Add**, and select **`bf16.ai`**.
4. Enter your `API Key`, confirm `API Base URL` is `https://api.bf16.ai/v1`, and click **Save and Fetch Models** (or add a model manually such as `deepseek/deepseek-v4.1-flash-uncensored`, `zai-org/glm-5.3-uncensored`, or `bf16/auto`).
5. Click `+` next to the desired model, enable **Vision** and **Tool Calling** if needed, and click **Test Model** to verify connectivity.

## Applying the Chat Model

Open **Config**, select your profile, go to **AI → Model**, set **Chat Model** to your bf16.ai model, and click **Save Configuration**.
15 changes: 15 additions & 0 deletions docs/zh/providers/bf16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 接入 bf16.ai

[bf16.ai](https://bf16.ai) 提供无审查(Uncensored)开源权重模型推理 API(DeepSeek V4.1 Flash、GLM-5.3、Kimi K3.1 Pro 以及 `bf16/auto` 智能路由),兼容 OpenAI 接口,支持 1M 上下文、视觉理解与结构化工具调用。由于模型权重层已去除过度拒答行为,AstrBot 多步自动化任务、技术群聊与 Agent 沙箱工作流不易被误拒中断,同时由 AstrBot 本地权限与沙箱策略守住安全边界。

## 配置对话模型

1. 注册并登录 [bf16.ai](https://bf16.ai)。
2. 在 [控制台 → API Keys](https://bf16.ai/dashboard/keys) 创建 API Key(以 `sk-bf16-v1-` 开头)。
3. 进入 AstrBot WebUI 的「模型提供商」→「对话」,点击「新增」,选择 `bf16.ai`。
4. 填写 `API Key`,确认 `API Base URL` 为 `https://api.bf16.ai/v1`,点击「保存并获取模型」(或手动填写模型 ID,如 `deepseek/deepseek-v4.1-flash-uncensored`、`zai-org/glm-5.3-uncensored`、`bf16/auto`)。
5. 在模型列表中点击所需模型右侧的 `+` 启用,按需开启视觉与工具调用能力,并点击「测试模型」验证连通性。

## 应用对话模型

进入「配置文件」,选择要使用的配置文件,在「AI」→「模型」中将「对话模型」设为刚添加的 bf16.ai 模型,点击右下角「保存配置」。