分类: AI源码问答

  • KnowStreaming 产品介绍与实现原理

    产品概述

    KnowStreaming 是一套云原生的 Apache Kafka 管控平台,专注于 Kafka 运维管控、监控告警、资源治理、多活容灾等核心场景。

    核心特点

    零侵入、全覆盖

    ● 无需侵入改造 Apache Kafka,一键便能纳管 0.10.x ~ 3.x.x 众多版本的 Kafka

    ● 支持 ZK 或 Raft 运行模式的版本

    ● 在兼容架构上具备良好的扩展性 

    零成本、界面化

    ● 提炼高频 CLI 能力,设计合理的产品路径

    ● 提供清新美观的 GUI 界面,支持 Cluster、Broker、Zookeeper、Topic、ConsumerGroup、Message、ACL、Connect 等组件 GUI 管理

    ● 普通用户 5 分钟即可上手 

    云原生、插件化

    ● 基于云原生构建,具备水平扩展能力

    ● 只需要增加节点即可获取更强的采集及对外服务能力

    ● 提供众多可热插拔的企业级特性 

    实现原理

    系统架构

    KnowStreaming 采用分层模块化架构设计:

    graph TD
        A[前端层 km-console] --> B[API层 km-rest]
        B --> C[业务层 km-biz]
        C --> D[核心层 km-core]
        D --> E[数据层 km-persistence]
        F[任务调度 km-task] --> D
        G[指标采集 km-collector] --> D
        H[系统监控 km-monitor] --> D
        I[共享工具 km-common] --> A
        I --> B
        I --> C
        I --> D

    采用微前端架构,包含两个主要应用:

    ● layout-clusters-fe: 主容器应用,处理多集群管理

    ● config-manager-fe: 子应用,处理系统管理和配置管理

    使用 single-spa 框架进行微前端编排,通过 AppContainer.useGlobalValue() 管理全局状态,包括用户信息和权限控制。

    后端实现原理

    Kafka 集群管理

    通过 KSPartialKafkaAdminClient 封装 Kafka Admin Client,实现对 Kafka 集群的操作。

    指标采集与监控

    ● 通过 JMX 连接采集 Broker 指标

    ● 使用 Elasticsearch 存储时序指标数据

    ● 支持多维度指标观测和健康巡检

    权限系统

    实现基于角色的权限控制(RBAC),通过 ClustersPermissionMap 定义权限枚举,在组件级别进行权限校验 。

    系统架构

    KnowStreaming 采用模块化设计,包含以下核心组件:

    ● km-console: Web UI 前端,采用微前端架构

    ● km-rest: REST API 层

    ● km-biz: 业务逻辑编排层

    ● km-core: 核心服务层

    ● km-task: 任务调度模块

    ● km-collector: 指标采集模块

    ● km-monitor: 系统监控模块

    ● km-persistence: 数据访问层

    ● km-common: 共享工具类 

    使用步骤

    1. 环境准备

    ● 准备 Kafka 集群(0.10.x ~ 3.x.x 版本)

    ● 准备 Elasticsearch 7.6+ 用于指标存储

    ● 准备 MySQL/MariaDB 用于元数据存储

    2. 部署安装

    # 1. 克隆代码
    git clone https://github.com/didi/KnowStreaming.git
     
    # 2. 编译打包
    mvn clean install -DskipTests
     
    # 3. 配置数据库
    # 修改 km-rest/src/main/resources/application.yml 中的数据库配置
     
    # 4. 启动服务
    java -jar km-rest/target/know-streaming.jar

    3. 集群接入

    1.  访问 Web 界面(默认 http://localhost:8080)

    2.  登录系统(默认账号:admin/admin)

    3.  进入”集群管理”页面

    4.  点击”新增集群”,填写 Kafka 集群信息: 集群名称

    a.  Bootstrap Servers

    b.  JMX 端口配置

    c.  认证配置(如需要)

    4. 功能使用

    集群监控

    ● 查看集群健康状态和核心指标

    ● 监控 Broker、Topic、Consumer Group 运行状态

    Topic 管理

    ● 创建、删除、修改 Topic

    ● 查看 Topic 详情和分区分布

    ● 执行扩缩副本、副本迁移操作

    Consumer Group 管理

    ● 查看 Consumer Group 列表和详情

    ● 监控消费延迟和消费状态

    ● 重置 Offset 和删除 Group 

    安全管理

    ● 配置 ACL 权限控制

    ● 管理用户和凭证 

    5. 高级配置

    ● 配置告警规则和通知渠道

    ● 设置指标采集频率和保留策略

    ● 启用集群负载均衡和自动运维功能

    Notes

    ● KnowStreaming 支持 ZK 和 Raft 两种运行模式的 Kafka 集群 

    ● 从 2.x 升级到 3.x 版本时,开源协议从 Apache License 2.0 调整为 AGPL 3.0 

    ● 生产环境建议使用 ES 7.6 版本,并创建近 7 天的索引模板 

    ● 如需对接 LDAP 认证,需要在 application.yml 中配置相关参数 

  • Clawdbot 产品功能与实现原理 

    产品概述

    Clawdbot 是一个个人 AI 助手平台,将消息渠道(WhatsApp、Telegram、Discord、Slack、Signal、iMessage 等)连接到在您自己设备上运行的 AI 代理。它作为一个本地优先的系统运行,其中 Gateway 控制平面管理渠道连接、代理执行和会话状态,而 Pi 代理运行时 处理与您工作区、浏览器和系统的工具访问的 AI 交互。

    核心功能

    多渠道消息集成

    ● WhatsApp (通过 Baileys WhatsApp Web 协议) 

    ● Telegram (Bot API / grammY) 

    ● Discord (Bot API / discord.js) 

    ● Slack (Bolt) 

    ● SignaliMessage 等更多渠道 

    智能代理系统

    ● Pi 代理运行时:基于 @mariozechner/pi-agent-core 的 RPC 模式集成 

    ● 多代理路由:将不同的渠道/账户/对等方路由到隔离的代理(工作区 + 每代理会话) 

    ● 会话管理:直接聊天折叠到共享的 main 会话;群组会话隔离 

    丰富的工具生态

    ● 浏览器控制:专用的 clawd Chrome/Chromium,支持 CDP 控制

    ● Canvas + A2UI:代理驱动的可视化工作空间 

    ● 节点功能:相机快照、屏幕录制、位置获取、通知 

    ● 语音唤醒 + 对话模式:macOS/iOS/Android 的始终在线语音功能 

    实现原理

    系统架构

    Clawdbot 围绕一个 Gateway 进程组织,该进程作为所有消息渠道、WebSocket 控制平面和代理编排的唯一真实来源。

    graph TB
        %% 外部消息平台子图 - 移除双引号嵌套,兼容所有解析器
        subgraph External 外部消息平台
            WA[WhatsApp]
            TG[Telegram]
            DC[Discord]
            SL[Slack]
        end
    
        %% Gateway进程 - 替换<br/>为空格,移除HTML标签
        subgraph Gateway Gateway进程 ws://127.0.0.1:18789
            GW[WebSocket + HTTP 服务器]
            MON[渠道监控器]
            AUTO[自动回复]
            SESS[会话管理]
        end
    
        %% 代理运行时子图
        subgraph Agent 代理运行时
            PI[Pi 嵌入式运行器]
            TOOLS[工具系统]
            SANDBOX[沙箱隔离]
        end
    
        %% 外部平台 -> 渠道监控器
        WA --> MON
        TG --> MON
        DC --> MON
        SL --> MON
        %% Gateway 内部流转
        MON --> GW
        GW --> AUTO
        AUTO --> SESS
        %% Gateway -> 代理运行时
        SESS --> PI
        %% 代理运行时内部依赖
        PI --> TOOLS
        PI --> SANDBOX

    1. Gateway 控制平面

    Gateway 是一个运行在端口 18789(可配置)上的 WebSocket 服务器,提供:

    ● WebSocket RPC 协议:用于 CLI、UI 和节点发出命令

    ● HTTP 端点:控制 UI、webhook、OpenAI 兼容 API、工具调用

    ● 渠道监控器:从外部平台轮询/流式传输事件并标准化消息

    ● Cron 服务:用于计划的代理运行

    ● 配置热重载:监视配置文件并采用混合重启策略

    2. 代理运行时

    Clawdbot 使用来自 @mariozechner/pi-agent-core 的 Pi 代理运行时,采用 RPC 模式。代理执行生命周期包括:

    1.  认证配置文件选择:轮换认证配置文件并跟踪失败配置文件的冷却时间

    2.  系统提示构建:组装 AGENTS.md、SOUL.md、TOOLS.md、技能快照和运行时上下文

    3.  工具注册:按策略过滤工具并创建 Pi 工具定义

    4.  会话运行:调用带历史记录的 session.prompt(),通过订阅流式传输块

    5.  响应传递:分块大响应、去重消息工具输出,并通过渠道发送

    3. 消息处理管道

    graph TB
    MSG["外部消息"] --> MON["渠道监控器"]
    MON --> CTX["标准化上下文"]
    CTX --> POL{"策略检查"}
    POL --> ROUTE{"代理路由"}
    ROUTE --> RUN["代理运行"]
    RUN --> SEND["渠道发送"]

    ● 策略执行:如果发送者不在允许列表中或提及要求失败,则早期拒绝消息

    ● 命令与自动回复:斜杠命令短路到本机处理程序;正常消息路由到代理

    ● 工具策略过滤:移除在任何级别被拒绝的工具

    ● 响应去重:跟踪工具输出以避免重复代理已通过 message_send 发送的内容

    安全模型

    Clawdbot 实施深度防御,具有多层安全:

    层级默认姿态配置
    DM 访问需要配对dmPolicy: “pairing”
    群组访问需要提及requireMention: true
    工具访问主会话主机执行,群组沙箱sandbox.mode: “non-main”
    Gateway 认证需要令牌(即使是环回)gateway.auth.token
    执行安全基于允许列表tools.exec.security: “allowlist”

    工具策略层次结构(7 个级别,拒绝总是获胜):

    全局 → 提供商 → 代理 → 群组 → 沙箱 → 子代理 → 配置文件

    部署模式

    本地 Gateway(默认)

    大多数用户在主计算机上运行 Gateway,使用 systemd/launchd 守护进程:

    clawdbot onboard --install-daemon
    clawdbot gateway status

    远程 Gateway

    对于 VPS 部署,在服务器上运行 Gateway 并通过 SSH 隧道或 Tailscale 连接本地客户端。

    Notes

    Clawdbot 是一个开源项目,采用 MIT 许可证。核心架构围绕单一 Gateway 进程设计,确保会话状态的一致性和渠道连接的稳定性。系统支持插件扩展,允许第三方渠道、工具和提供商而无需修改核心代码。详细的配置选项和部署场景请参考官方文档。

  • Tailwind CSS 是一款革命性的实用优先(Utility-First)CSS 框架

    你想了解的 Tailwind CSS 是由 Tailwind Labs 开发的一款革命性的实用优先(Utility-First)CSS 框架,它彻底改变了传统 CSS 的编写方式。

    一、核心概念与定位

    Tailwind CSS 不是像 Bootstrap、Element UI 那样提供现成的组件(如按钮、卡片),而是提供了大量原子化的 CSS 工具类(Utility Classes),让你可以直接在 HTML 中通过组合这些类来构建任意样式的界面,无需编写自定义 CSS。

    举个直观对比:

    ● 传统 CSS 方式:先写 CSS 类名,再写样式

    /* CSS 文件 */
    .btn-primary {
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    border-radius: 0.25rem;
    color: white;
    }
    <!-- HTML 文件 -->
    <button class="btn-primary">按钮</button>

    ● Tailwind CSS 方式:直接用工具类组合

    <button class="px-4 py-2 bg-blue-500 rounded text-white">按钮</button>

    二、核心优势

    1.  极高的灵活性

    2.  摆脱预设组件的限制,你可以完全按照设计稿的要求组合样式,不会出现 “框架自带样式改起来比自己写还麻烦” 的问题。极高的开发效率

    a.  无需在 HTML 和 CSS 文件之间来回切换

    b.  无需绞尽脑汁想类名(如 btn-primary、card-header 等)

    c.  工具类命名遵循统一规则(如 bg-* 控制背景色、p-* 控制内边距),记熟后编写速度极快

    3.  极致的性能

    4.  通过内置的 PurgeCSS 功能(现在叫 JIT 模式),最终打包时会自动移除所有未使用的工具类,生成的 CSS 文件体积极小(通常只有几 KB)。高度可定制化

    你可以通过 tailwind.config.js 配置文件自定义颜色、字体、间距、断点等所有设计变量,轻松适配自己的品牌风格。

    三、基本使用步骤

    1.  安装(以 npm 为例)

    # 初始化项目(如未初始化)
    npm init -y
    # 安装 Tailwind CSS 及依赖
    npm install -D tailwindcss postcss autoprefixer
    # 生成配置文件
    npx tailwindcss init -p

    2.  配置 Tailwind

    修改 tailwind.config.js,指定需要扫描的文件路径:

    /** @type {import('tailwindcss').Config} */
    module.exports = {
    content: ["./src/**/*.{html,js}"], // 扫描 src 下所有 html/js 文件
    theme: {
    extend: {}, // 扩展自定义样式
    },
    plugins: [],
    }

    3.  引入基础样式

    创建 CSS 文件(如 src/style.css),引入 Tailwind 的核心样式:

    @tailwind base;    /* 基础样式重置 */
    @tailwind components; /* 组件类(可选) */
    @tailwind utilities; /* 工具类(核心) */

    4.  编译并使用

    # 开发环境(实时编译)
    npx tailwindcss -i ./src/style.css -o ./dist/style.css --watch

    在 HTML 中引入编译后的 CSS 文件,即可使用 Tailwind 工具类:

    <!DOCTYPE html>
    <html>
    <head>
    <link href="/dist/style.css" rel="stylesheet">
    </head>
    <body>
    <div class="container mx-auto p-4 bg-gray-100 rounded-lg">
    <h1 class="text-3xl font-bold text-blue-600">Hello Tailwind!</h1>
    </div>
    </body>
    </html>

    四、典型应用场景

    ● 快速构建原型:无需编写 CSS,直接组合工具类即可出效果

    ● 定制化要求高的项目:摆脱框架组件的样式束缚

    ● 响应式开发:内置 sm:、md:、lg: 等断点前缀,轻松实现响应式

    <div class="text-sm md:text-lg lg:text-xl">响应式文字大小</div>

    ● 团队协作:统一的工具类命名规则,降低样式维护成本

    总结

    1.  Tailwind CSS 是实用优先的 CSS 框架,核心是原子化工具类,而非预设组件;

    2.  优势在于灵活性高、开发效率快、性能优秀,且支持高度定制;

    3.  核心使用方式是通过组合 HTML 中的工具类实现样式,最终打包时会移除未使用的类,保证体积最小。

    如果你是前端开发新手,Tailwind CSS 能让你快速上手样式开发;如果你是资深开发者,它能大幅提升项目的样式开发和维护效率。

  • HumanEval 和 MBPP 是什么,为什么可以用来测试代码能力

    HumanEval 和 MBPP 是当前学术界广泛使用的两个代码生成评测数据集,专门用于评估AI模型的代码能力。它们的设计逻辑和使用价值如下:

    一、数据集简介

    HumanEval

    • 来源:由 OpenAI 在 2021 年创建并发布
    • 内容:包含 164 个手写的编程问题
    • 特点
    • 每个问题包含:函数签名、英文描述、函数体注释、多个测试用例
    • 涵盖算法、数据结构、字符串处理等多种编程任务
    • 难度适中,类似入门到中级编程面试题

    MBPP (Mostly Basic Programming Problems)

    • 来源:Google Research 在 2021 年发布
    • 内容:包含约 974 个编程问题
    • 特点
    • 问题相对基础,更适合初学者水平
    • 每个问题有自然语言描述、函数签名和测试用例
    • 部分问题来自编程竞赛网站

    二、为什么能有效测试代码能力

    1. 综合性评估维度

    • 语法正确性:能否生成符合语法的代码
    • 逻辑正确性:算法实现是否解决给定问题
    • 边界情况处理:测试用例覆盖各种边界条件
    • 代码质量:代码是否简洁、高效

    2. 标准化的评估方法

    采用 Pass@k 指标:

    • 让模型生成 k 个代码方案
    • 计算至少有一个通过所有测试用例的概率
    • 如 Pass@1(第一次生成就正确)、Pass@10 等
    • 消除了主观评判的偏差

    3. 实际解决问题的能力

    • 问题描述使用自然语言,模拟真实编程场景
    • 需要理解需求 → 设计算法 → 实现代码的完整流程
    • 测试用例验证功能正确性,而不仅仅是表面相似性

    三、在AI评估中的重要性

    1. 基准测试的统一标准

    • 成为比较不同代码生成模型(如Codex、GitHub Copilot、DeepSeek-Coder等)的“标尺”
    • 研究论文几乎都报告在这些数据集上的表现

    2. 反映实际应用潜力

    • 高 HumanEval/MBPP 分数的模型在实际编程辅助中通常表现更好
    • 与开发者的使用体验相关性较强

    3. 推动技术进步

    • 清晰的量化指标促使模型改进
    • 帮助识别模型的弱点(如特定类型问题处理不佳)

    四、局限性

    1. 有限的问题范围:164/974个问题不能覆盖所有编程场景
    2. 缺乏复杂系统设计:主要是独立函数,不涉及架构设计
    3. 代码风格单一:偏向算法题,较少涉及实际工程问题
    4. 可能过拟合:有些模型可能针对性优化这些数据集

    五、扩展和补充

    学术界还开发了其他补充数据集:

    • DS-1000:数据科学代码生成
    • APPS:更复杂的竞赛编程问题
    • CodeContests:来自编程竞赛的真实题目
    • HumanEval+:增加更多测试用例,防止“幸运通过”

    总结

    HumanEval 和 MBPP 之所以成为代码能力测试的黄金标准,是因为它们提供了客观、可重复、全面的评估框架,能够有效区分不同模型的代码生成能力。虽然不能完全代表实际工程能力,但作为基准测试工具,它们对推动代码生成技术的发展起到了关键作用。

    对于AI模型开发者来说,在这些数据集上的表现是衡量技术进步的重要指标;对于使用者来说,可以间接反映模型在实际编程辅助中的潜力。

  • deepseek-ai/DeepSeek-V3 混合专家(MoE)语言模型

    DeepSeek-V3 是 DeepSeek-AI 开发的先进混合专家(MoE)语言模型,具有671B总参数和每个token激活37B参数的强大能力 1

    核心技术架构

    创新架构设计

    DeepSeek-V3 基于三大核心技术构建 2

    1. 多头潜在注意力(MLA) – 实现高效的注意力机制
    2. DeepSeekMoE架构 – 混合专家模型设计
    3. 多令牌预测(MTP) – 新的训练目标,支持推测解码加速

    训练效率

    模型在14.8万亿高质量token上进行预训练,仅需2.788M H800 GPU小时完成全训练 3 。训练过程极其稳定,整个训练过程中未出现不可恢复的损失峰值或回滚 4

    模型规格

    模型版本总参数激活参数上下文长度下载地址
    DeepSeek-V3-Base671B37B128KHugging Face 5
    DeepSeek-V3671B37B128KHugging Face 6

    模型总大小为685B参数,包括671B主模型权重和14B多令牌预测(MTP)模块权重 7

    性能表现

    DeepSeek-V3 在各项基准测试中表现卓越,特别是在数学和代码任务上 8

    • 数学能力: GSM8K达到89.3%,MATH达到61.6%
    • 代码能力: HumanEval达到65.2%,MBPP达到75.4%
    • 综合推理: MMLU达到87.1%,BBH达到87.5%

    在聊天模型评估中,DeepSeek-V3 在开放生成任务上表现突出,Arena-Hard达到85.5,AlpacaEval 2.0达到70.0 9

    部署选项

    支持的框架

    DeepSeek-V3 支持多种部署框架 10

    1. DeepSeek-Infer Demo – 轻量级FP8和BF16推理演示
    2. SGLang – 完整支持BF16和FP8推理模式
    3. LMDeploy – 高效本地和云端部署
    4. TensorRT-LLM – 支持BF16推理和INT4/8量化
    5. vLLM – 支持张量并行和流水线并行
    6. LightLLM – 单节点或多节点部署
    7. AMD GPU – 通过SGLang支持
    8. 华为昇腾NPU – 支持INT8和BF16

    权重格式

    模型原生采用FP8格式提供,支持128×128块缩放 11 。如需BF16格式,可使用转换脚本进行转换 12

    使用许可

    DeepSeek-V3 系列模型支持商业使用 13 。代码仓库采用MIT许可证,模型使用遵循模型许可证条款 14

    使用限制

    模型使用受到以下限制 15

    • 不得违反适用法律法规
    • 不得用于军事用途
    • 不得用于伤害未成年人
    • 不得生成虚假信息伤害他人
    • 不得用于歧视性或有害的自动化决策

    获取方式


    Notes

    DeepSeek-V3 是目前最强大的开源语言模型之一,在保持高性能的同时显著降低了训练成本。其创新的架构设计和训练方法为大规模语言模型的发展提供了新的方向。模型支持多种硬件平台和部署方式,为开发者和企业提供了灵活的选择。

    Wiki pages you might want to explore:

    Citations

    File: README.md (L47-47)

    We present DeepSeek-V3, a strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token. 

    File: README.md (L48-49)

    To achieve efficient inference and cost-effective training, DeepSeek-V3 adopts Multi-head Latent Attention (MLA) and DeepSeekMoE architectures, which were thoroughly validated in DeepSeek-V2. 
    Furthermore, DeepSeek-V3 pioneers an auxiliary-loss-free strategy for load balancing and sets a multi-token prediction training objective for stronger performance. 

    File: README.md (L50-52)

    We pre-train DeepSeek-V3 on 14.8 trillion diverse and high-quality tokens, followed by Supervised Fine-Tuning and Reinforcement Learning stages to fully harness its capabilities. 
    Comprehensive evaluations reveal that DeepSeek-V3 outperforms other open-source models and achieves performance comparable to leading closed-source models.
    Despite its excellent performance, DeepSeek-V3 requires only 2.788M H800 GPU hours for its full training.

    File: README.md (L53-54)

    In addition, its training process is remarkably stable. 
    Throughout the entire training process, we did not experience any irrecoverable loss spikes or perform any rollbacks. 

    File: README.md (L93-93)

    | DeepSeek-V3-Base | 671B | 37B | 128K   | [🤗 Hugging Face](https://huggingface.co/deepseek-ai/DeepSeek-V3-Base)   |

    File: README.md (L94-94)

    | DeepSeek-V3   | 671B | 37B |  128K   | [🤗 Hugging Face](https://huggingface.co/deepseek-ai/DeepSeek-V3)   |

    File: README.md (L99-99)

    > The total size of DeepSeek-V3 models on Hugging Face is 685B, which includes 671B of the Main Model weights and 14B of the Multi-Token Prediction (MTP) Module weights.

    File: README.md (L153-153)

    > Best results are shown in bold. Scores with a gap not exceeding 0.3 are considered to be at the same level. DeepSeek-V3 achieves the best performance on most benchmarks, especially on math and code tasks.

    File: README.md (L214-214)

    | DeepSeek-V3 | **85.5** | **70.0** |

    File: README.md (L223-223)

    You can chat with DeepSeek-V3 on DeepSeek's official website: [chat.deepseek.com](https://chat.deepseek.com/sign_in)

    File: README.md (L225-225)

    We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.com](https://platform.deepseek.com/)

    File: README.md (L231-238)

    1. **DeepSeek-Infer Demo**: We provide a simple and lightweight demo for FP8 and BF16 inference.
    2. **SGLang**: Fully support the DeepSeek-V3 model in both BF16 and FP8 inference modes, with Multi-Token Prediction [coming soon](https://github.com/sgl-project/sglang/issues/2591).
    3. **LMDeploy**: Enables efficient FP8 and BF16 inference for local and cloud deployment.
    4. **TensorRT-LLM**: Currently supports BF16 inference and INT4/8 quantization, with FP8 support coming soon.
    5. **vLLM**: Support DeepSeek-V3 model with FP8 and BF16 modes for tensor parallelism and pipeline parallelism.
    6. **LightLLM**: Supports efficient single-node or multi-node deployment for FP8 and BF16.
    7. **AMD GPU**: Enables running the DeepSeek-V3 model on AMD GPUs via SGLang in both BF16 and FP8 modes.
    8. **Huawei Ascend NPU**: Supports running DeepSeek-V3 on Huawei Ascend devices in both INT8 and BF16.

    File: README.md (L244-247)

    ```shell
    cd inference
    python fp8_cast_bf16.py --input-fp8-hf-path /path/to/fp8_weights --output-bf16-hf-path /path/to/bf16_weights
    **File:** README.md (L345-345)

    markdown
    This code repository is licensed under the MIT License. The use of DeepSeek-V3 Base/Chat models is subject to the Model License. DeepSeek-V3 series (including Base and Chat) supports commercial use.

    **File:** README_WEIGHTS.md (L62-62)

    markdown
    DeepSeek-V3 natively supports FP8 weight format with 128×128 block scaling.

    **File:** LICENSE-MODEL (L37-39)

    text

    1. Grant of Copyright License. Subject to the terms and conditions of this License, DeepSeek hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Complementary Material, the Model, and Derivatives of the Model.
    2. Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, DeepSeek hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and the Complementary Material, where such license applies only to those patent claims licensable by DeepSeek that are necessarily infringed by its contribution(s). If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model and/or Complementary Material constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for … (truncated)
    **File:** LICENSE-MODEL (L79-90)

    text
    You agree not to use the Model or Derivatives of the Model:

    • In any way that violates any applicable national or international law or regulation or infringes upon the lawful rights and interests of any third party;
    • For military use in any way;
    • For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
    • To generate or disseminate verifiably false information and/or content with the purpose of harming others;
    • To generate or disseminate inappropriate content subject to applicable regulatory requirements;
    • To generate or disseminate personal identifiable information without due authorization or for unreasonable use;
    • To defame, disparage or otherwise harass others;
    • For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
    • For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;
    • To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;
      “`