[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-aallam--openai-kotlin":3,"similar-aallam--openai-kotlin":192},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":9,"readme_en":10,"readme_zh":11,"quickstart_zh":12,"use_case_zh":13,"hero_image_url":14,"owner_login":15,"owner_name":16,"owner_avatar_url":17,"owner_bio":18,"owner_company":19,"owner_location":20,"owner_email":21,"owner_twitter":21,"owner_website":21,"owner_url":22,"languages":23,"stars":28,"forks":29,"last_commit_at":30,"license":31,"difficulty_score":32,"env_os":33,"env_gpu":33,"env_ram":33,"env_deps":34,"category_tags":40,"github_topics":47,"view_count":32,"oss_zip_url":21,"oss_zip_packed_at":21,"status":59,"created_at":60,"updated_at":61,"faqs":62,"releases":91},5023,"aallam\u002Fopenai-kotlin","openai-kotlin","OpenAI API client for Kotlin with multiplatform and coroutines capabilities.","openai-kotlin 是一款专为 Kotlin 开发者打造的 OpenAI API 客户端库，旨在让 Kotlin 生态下的应用能够轻松、高效地集成人工智能能力。它解决了开发者在 Kotlin 项目中调用 OpenAI 服务时，需要手动处理底层 HTTP 请求、数据序列化及异步流程的繁琐问题，提供了类型安全且简洁的代码接口。\n\n这款工具特别适合使用 Kotlin 进行后端开发、Android 应用构建或跨平台项目研发的工程师。无论是需要快速原型验证的研究人员，还是致力于生产环境落地的资深开发者，都能通过它轻松实现聊天机器人、图像生成、文本嵌入及语音处理等功能。\n\nopenai-kotlin 的核心亮点在于其原生支持 Kotlin 协程（Coroutines），让异步 API 调用写得像同步代码一样清晰流畅，极大提升了代码的可读性与维护性。同时，它具备强大的多平台（Multiplatform）特性，一套代码即可运行于 JVM、JavaScript、Native 等多种环境。此外，库中完整覆盖了 OpenAI 的主流功能，包括最新的 Assistants API 等测试特性，并贴心地","openai-kotlin 是一款专为 Kotlin 开发者打造的 OpenAI API 客户端库，旨在让 Kotlin 生态下的应用能够轻松、高效地集成人工智能能力。它解决了开发者在 Kotlin 项目中调用 OpenAI 服务时，需要手动处理底层 HTTP 请求、数据序列化及异步流程的繁琐问题，提供了类型安全且简洁的代码接口。\n\n这款工具特别适合使用 Kotlin 进行后端开发、Android 应用构建或跨平台项目研发的工程师。无论是需要快速原型验证的研究人员，还是致力于生产环境落地的资深开发者，都能通过它轻松实现聊天机器人、图像生成、文本嵌入及语音处理等功能。\n\nopenai-kotlin 的核心亮点在于其原生支持 Kotlin 协程（Coroutines），让异步 API 调用写得像同步代码一样清晰流畅，极大提升了代码的可读性与维护性。同时，它具备强大的多平台（Multiplatform）特性，一套代码即可运行于 JVM、JavaScript、Native 等多种环境。此外，库中完整覆盖了 OpenAI 的主流功能，包括最新的 Assistants API 等测试特性，并贴心地提供了 BOM 依赖管理方案，帮助团队统一版本，减少配置冲突。如果你希望在 Kotlin 项目中优雅地接入大模型能力，openai-kotlin 是一个专业且可靠的选择。","# OpenAI API client for Kotlin\n\n[![Maven Central](https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fcom.aallam.openai\u002Fopenai-client?color=blue&label=Download)](https:\u002F\u002Fcentral.sonatype.com\u002Fnamespace\u002Fcom.aallam.openai)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FAallam\u002Fopenai-kotlin?color=yellow)](LICENSE.md)\n[![Documentation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-api-a97bff.svg?logo=kotlin)](https:\u002F\u002Fmouaad.aallam.com\u002Fopenai-kotlin\u002F)\n\nKotlin client for [OpenAI's API](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference) with multiplatform and coroutines\ncapabilities.\n\n## 📦 Setup\n\n1. Install OpenAI API Kotlin client by adding the following dependency to your `build.gradle` file:\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"com.aallam.openai:openai-client:4.1.0\"\n}\n```\n\n2. Choose and add to your dependencies one of [Ktor's engines](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html).\n\n#### BOM\n\nAlternatively, you can use [openai-client-bom](\u002Fopenai-client-bom)  by adding the following dependency to your `build.gradle` file\n\n```groovy\ndependencies {\n    \u002F\u002F import Kotlin API client BOM\n    implementation platform('com.aallam.openai:openai-client-bom:4.1.0')\n\n    \u002F\u002F define dependencies without versions\n    implementation 'com.aallam.openai:openai-client'\n    runtimeOnly 'io.ktor:ktor-client-okhttp'\n}\n```\n\n### Multiplatform\n\nIn multiplatform projects, add openai client dependency to `commonMain`, and choose\nan [engine](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html) for each target.\n\n### Maven\n\nGradle is required for multiplatform support, but there's nothing stopping you from using the jvm client in a Maven\nproject. You still need to add to your dependencies one\nof [Ktor's engines](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html).\n\n\u003Cdetails>\n \u003Csummary>Setup the client with maven\u003C\u002Fsummary>\n\n```xml\n\u003Cdependencies>\n    \u003Cdependency>\n        \u003CgroupId>com.aallam.openai\u003C\u002FgroupId>\n        \u003CartifactId>openai-client-jvm\u003C\u002FartifactId>\n        \u003Cversion>4.1.0\u003C\u002Fversion>\n    \u003C\u002Fdependency>\n            \n    \u003Cdependency>\n        \u003CgroupId>io.ktor\u003C\u002FgroupId>\n        \u003CartifactId>ktor-client-okhttp-jvm\u003C\u002FartifactId>\n        \u003Cversion>3.0.0\u003C\u002Fversion>\n        \u003Cscope>runtime\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n\u003C\u002Fdetails>\n\nThe BOM is not supported for Maven projects.\n\n## ⚡️ Getting Started\n\n> [!NOTE]\n> OpenAI encourages using environment variables for the API key.\n> [Read more](https:\u002F\u002Fhelp.openai.com\u002Fen\u002Farticles\u002F5112595-best-practices-for-api-key-safety).\n\nCreate an instance of `OpenAI` client:\n\n```kotlin\nval openai = OpenAI(\n    token = \"your-api-key\",\n    timeout = Timeout(socket = 60.seconds),\n    \u002F\u002F additional configurations...\n)\n```\n\nOr you can create an instance of `OpenAI` using a pre-configured `OpenAIConfig`:\n\n```kotlin\nval config = OpenAIConfig(\n    token = apiKey,\n    timeout = Timeout(socket = 60.seconds),\n    \u002F\u002F additional configurations...\n)\n\nval openAI = OpenAI(config)\n```\n\nUse your `OpenAI` instance to make API requests. [Learn more](guides\u002FGettingStarted.md).\n\n### Supported features\n\n- [Responses](guides\u002FGettingStarted.md#responses)\n- [Models](guides\u002FGettingStarted.md#models)\n- [Chat](guides\u002FGettingStarted.md#chat)\n- [Images](guides\u002FGettingStarted.md#images)\n- [Embeddings](guides\u002FGettingStarted.md#embeddings)\n- [Files](guides\u002FGettingStarted.md#files)\n- [Fine-tuning](guides\u002FGettingStarted.md#fine-tuning)\n- [Moderations](guides\u002FGettingStarted.md#moderations)\n- [Audio](guides\u002FGettingStarted.md#audio)\n- [Batch](guides\u002FGettingStarted.md#batch)\n\n#### Beta\n\n- [Assistants](guides\u002FGettingStarted.md#assistants)\n- [Threads](guides\u002FGettingStarted.md#threads)\n- [Messages](guides\u002FGettingStarted.md#messages)\n- [Runs](guides\u002FGettingStarted.md#runs)\n- [Vector Stores](guides\u002FGettingStarted.md#vector-stores)\n\n#### Deprecated\n- [Completions](guides\u002FGettingStarted.md#completions)\n- [Fine-tunes](guides\u002FGettingStarted.md#fine-tunes)\n- [Edits](guides\u002FGettingStarted.md#edits)\n\n*Looking for a tokenizer? Try [ktoken](https:\u002F\u002Fgithub.com\u002Faallam\u002Fktoken), a Kotlin library for tokenizing text.*\n\n## 📚 Guides\n\nGet started and understand more about how to use OpenAI API client for Kotlin with these guides:\n\n- [Getting Started](guides\u002FGettingStarted.md)\n- [Chat & Tool Calls](guides\u002FChatToolCalls.md)\n- [FileSource Guide](guides\u002FFileSource.md)\n- [Assistants](guides\u002FAssistants.md)\n\n## ℹ️ Sample apps\n\nSample apps are available under `sample`, please check the [README](sample\u002FREADME.md) for running instructions.\n\n## 🔒 ProGuard \u002F R8\n\nThe specific rules are [already bundled](openai-core\u002Fsrc\u002FjvmMain\u002Fresources\u002FMETA-INF\u002Fproguard\u002Fopenai.pro) into the Jar which can be interpreted by R8 automatically.\n\n## 📸 Snapshots\n\n[![Snapshot](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdynamic\u002Fxml?url=https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002Fcom\u002Faallam\u002Fopenai\u002Fopenai-client\u002Fmaven-metadata.xml&label=snapshot&color=red&query=.\u002F\u002Fversioning\u002Flatest)](https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002Fcom\u002Faallam\u002Fopenai\u002Fopenai-client\u002F)\n\n\u003Cdetails>\n \u003Csummary>Learn how to import snapshot version\u003C\u002Fsummary>\n\nTo import snapshot versions into your project, add the following code snippet to your gradle file:\n\n```groovy\nrepositories {\n   \u002F\u002F...\n   maven { url 'https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002F' }\n}\n```\n\n\u003C\u002Fdetails>\n\n## 🛠️ Troubleshooting\n\nFor common issues and their solutions, check the [Troubleshooting Guide](TROUBLESHOOTING.md).\n\n## 🧪 Testing\n\n`openai-client` tests are live integration tests and can generate billable API traffic.\n\n- Default (non-billable): live tests are disabled.\n- Opt-in live tests: set `OPENAI_LIVE_TESTS=1` and `OPENAI_API_KEY`.\n\nExamples:\n\n```bash\n# Free\u002Foffline checks\n.\u002Fgradlew :openai-core:jvmTest :openai-core:jsTest :openai-core:wasmJsTest :openai-core:apiCheck :openai-client:apiCheck\n\n# Live smoke (billable)\nOPENAI_LIVE_TESTS=1 OPENAI_API_KEY=... .\u002Fgradlew :openai-client:jvmTest --tests \"*.TestModels\"\n```\n\n## ⭐️ Support\n\nAppreciate the project? Here's how you can help:\n\n1. **Star**: Give it a star at the top right. It means a lot!\n2. **Contribute**: Found an issue or have a feature idea? Submit a PR.\n3. **Feedback**: Have suggestions? Open an issue or start a discussion.\n\n## 📄 License\n\nOpenAI Kotlin API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).\n**This is an unofficial library, it is not affiliated with nor endorsed by OpenAI**. Contributions are welcome.\n","# Kotlin 的 OpenAI API 客户端\n\n[![Maven Central](https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fcom.aallam.openai\u002Fopenai-client?color=blue&label=Download)](https:\u002F\u002Fcentral.sonatype.com\u002Fnamespace\u002Fcom.aallam.openai)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FAallam\u002Fopenai-kotlin?color=yellow)](LICENSE.md)\n[![Documentation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-api-a97bff.svg?logo=kotlin)](https:\u002F\u002Fmouaad.aallam.com\u002Fopenai-kotlin\u002F)\n\n适用于 [OpenAI API](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference) 的 Kotlin 客户端，具备多平台和协程支持。\n\n## 📦 设置\n\n1. 通过将以下依赖项添加到 `build.gradle` 文件中来安装 OpenAI API Kotlin 客户端：\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"com.aallam.openai:openai-client:4.1.0\"\n}\n```\n\n2. 从 [Ktor 的引擎](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html) 中选择一个并将其添加到您的依赖项中。\n\n### BOM\n\n或者，您也可以使用 [openai-client-bom](\u002Fopenai-client-bom)，只需将以下依赖项添加到 `build.gradle` 文件中：\n\n```groovy\ndependencies {\n    \u002F\u002F 导入 Kotlin API 客户端 BOM\n    implementation platform('com.aallam.openai:openai-client-bom:4.1.0')\n\n    \u002F\u002F 定义不带版本号的依赖项\n    implementation 'com.aallam.openai:openai-client'\n    runtimeOnly 'io.ktor:ktor-client-okhttp'\n}\n```\n\n### 多平台\n\n在多平台项目中，将 openai 客户端依赖项添加到 `commonMain`，并为每个目标选择一个 [引擎](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html)。\n\n### Maven\n\nGradle 是支持多平台所必需的，但您仍然可以在 Maven 项目中使用 JVM 客户端。不过，您仍需将 [Ktor 的引擎](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html) 添加到您的依赖项中。\n\n\u003Cdetails>\n \u003Csummary>使用 Maven 设置客户端\u003C\u002Fsummary>\n\n```xml\n\u003Cdependencies>\n    \u003Cdependency>\n        \u003CgroupId>com.aallam.openai\u003C\u002FgroupId>\n        \u003CartifactId>openai-client-jvm\u003C\u002FartifactId>\n        \u003Cversion>4.1.0\u003C\u002Fversion>\n    \u003C\u002Fdependency>\n            \n    \u003Cdependency>\n        \u003CgroupId>io.ktor\u003C\u002FgroupId>\n        \u003CartifactId>ktor-client-okhttp-jvm\u003C\u002FartifactId>\n        \u003Cversion>3.0.0\u003C\u002Fversion>\n        \u003Cscope>runtime\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n\u003C\u002Fdetails>\n\nBOM 不支持 Maven 项目。\n\n## ⚡️ 入门\n\n> [!NOTE]\n> OpenAI 建议使用环境变量来存储 API 密钥。\n> [了解更多](https:\u002F\u002Fhelp.openai.com\u002Fen\u002Farticles\u002F5112595-best-practices-for-api-key-safety)。\n\n创建一个 `OpenAI` 客户端实例：\n\n```kotlin\nval openai = OpenAI(\n    token = \"your-api-key\",\n    timeout = Timeout(socket = 60.seconds),\n    \u002F\u002F 其他配置...\n)\n```\n\n或者，您也可以使用预先配置的 `OpenAIConfig` 创建 `OpenAI` 实例：\n\n```kotlin\nval config = OpenAIConfig(\n    token = apiKey,\n    timeout = Timeout(socket = 60.seconds),\n    \u002F\u002F 其他配置...\n)\n\nval openAI = OpenAI(config)\n```\n\n使用您的 `OpenAI` 实例发送 API 请求。[了解更多](guides\u002FGettingStarted.md)。\n\n### 支持的功能\n\n- [响应](guides\u002FGettingStarted.md#responses)\n- [模型](guides\u002FGettingStarted.md#models)\n- [聊天](guides\u002FGettingStarted.md#chat)\n- [图片](guides\u002FGettingStarted.md#images)\n- [嵌入](guides\u002FGettingStarted.md#embeddings)\n- [文件](guides\u002FGettingStarted.md#files)\n- [微调](guides\u002FGettingStarted.md#fine-tuning)\n- [内容审核](guides\u002FGettingStarted.md#moderations)\n- [音频](guides\u002FGettingStarted.md#audio)\n- [批处理](guides\u002FGettingStarted.md#batch)\n\n#### 测试版\n\n- [助手](guides\u002FGettingStarted.md#assistants)\n- [线程](guides\u002FGettingStarted.md#threads)\n- [消息](guides\u002FGettingStarted.md#messages)\n- [运行](guides\u002FGettingStarted.md#runs)\n- [向量存储](guides\u002FGettingStarted.md#vector-stores)\n\n#### 已弃用\n\n- [完成](guides\u002FGettingStarted.md#completions)\n- [微调](guides\u002FGettingStarted.md#fine-tunes)\n- [编辑](guides\u002FGettingStarted.md#edits)\n\n*正在寻找分词器吗？试试 [ktoken](https:\u002F\u002Fgithub.com\u002Faallam\u002Fktoken)，一个用于文本分词的 Kotlin 库。*\n\n## 📚 指南\n\n通过以下指南开始使用并深入了解如何使用 Kotlin 的 OpenAI API 客户端：\n\n- [入门](guides\u002FGettingStarted.md)\n- [聊天与工具调用](guides\u002FChatToolCalls.md)\n- [文件源指南](guides\u002FFileSource.md)\n- [助手](guides\u002FAssistants.md)\n\n## ℹ️ 示例应用\n\n示例应用位于 `sample` 目录下，请查看 [README](sample\u002FREADME.md) 以获取运行说明。\n\n## 🔒 ProGuard \u002F R8\n\n特定规则已[打包](openai-core\u002Fsrc\u002FjvmMain\u002Fresources\u002FMETA-INF\u002Fproguard\u002Fopenai.pro)到 Jar 文件中，R8 可以自动解析这些规则。\n\n## 📸 快照\n\n[![Snapshot](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdynamic\u002Fxml?url=https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002Fcom\u002Faallam\u002Fopenai\u002Fopenai-client\u002Fmaven-metadata.xml&label=snapshot&color=red&query=.\u002F\u002Fversioning\u002Flatest)](https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002Fcom\u002Faallam\u002Fopenai\u002Fopenai-client\u002F)\n\n\u003Cdetails>\n \u003Csummary>了解如何导入快照版本\u003C\u002Fsummary>\n\n要将快照版本导入您的项目，请将以下代码片段添加到您的 Gradle 文件中：\n\n```groovy\nrepositories {\n   \u002F\u002F...\n   maven { url 'https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002F' }\n}\n```\n\n\u003C\u002Fdetails>\n\n## 🛠️ 故障排除\n\n有关常见问题及其解决方案，请参阅 [故障排除指南](TROUBLESHOOTING.md)。\n\n## 🧪 测试\n\n`openai-client` 的测试是实时集成测试，可能会产生需要付费的 API 流量。\n\n- 默认设置（不计费）：禁用实时测试。\n- 开启实时测试：设置 `OPENAI_LIVE_TESTS=1` 和 `OPENAI_API_KEY`。\n\n示例：\n\n```bash\n# 免费\u002F离线检查\n.\u002Fgradlew :openai-core:jvmTest :openai-core:jsTest :openai-core:wasmJsTest :openai-core:apiCheck :openai-client:apiCheck\n\n# 实时冒烟测试（计费）\nOPENAI_LIVE_TESTS=1 OPENAI_API_KEY=... .\u002Fgradlew :openai-client:jvmTest --tests \"*.TestModels\"\n```\n\n## ⭐️ 支持\n\n喜欢这个项目吗？您可以这样帮助我们：\n\n1. **Star**：在右上角给它点个赞吧！这对我们意义重大。\n2. **贡献**：发现 bug 或有功能建议？提交 PR 吧。\n3. **反馈**：有任何建议？开个 issue 或发起讨论吧。\n\n## 📄 许可证\n\nOpenAI Kotlin API 客户端是一个开源软件，采用 [MIT 许可证](LICENSE.md)授权。\n**这是一个非官方库，与 OpenAI 无关联，也未得到其认可**。欢迎贡献。","# openai-kotlin 快速上手指南\n\n## 环境准备\n\n- **运行环境**：JDK 8+ 或 Kotlin Multiplatform 项目\n- **构建工具**：Gradle（推荐，支持多平台）或 Maven（仅支持 JVM）\n- **前置依赖**：需引入 [Ktor HTTP Client](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html) 的任意引擎（如 `ktor-client-okhttp`）\n- **API 密钥**：请提前在 [OpenAI 平台](https:\u002F\u002Fplatform.openai.com\u002Fapi-keys) 获取 API Key，建议通过环境变量管理\n\n> 💡 提示：国内开发者若遇到网络延迟，可配置代理或在 Ktor 引擎中设置代理地址。\n\n## 安装步骤\n\n### 方式一：Gradle (推荐)\n\n在 `build.gradle` 文件中添加以下配置：\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"com.aallam.openai:openai-client:4.1.0\"\n    \u002F\u002F 必须添加一个 Ktor 引擎，例如 OkHttp\n    runtimeOnly 'io.ktor:ktor-client-okhttp:3.0.0'\n}\n```\n\n**或使用 BOM 管理版本：**\n\n```groovy\ndependencies {\n    \u002F\u002F 导入 BOM\n    implementation platform('com.aallam.openai:openai-client-bom:4.1.0')\n\n    \u002F\u002F 定义依赖（无需指定版本）\n    implementation 'com.aallam.openai:openai-client'\n    runtimeOnly 'io.ktor:ktor-client-okhttp'\n}\n```\n\n### 方式二：Maven (仅 JVM)\n\n在 `pom.xml` 中添加：\n\n```xml\n\u003Cdependencies>\n    \u003Cdependency>\n        \u003CgroupId>com.aallam.openai\u003C\u002FgroupId>\n        \u003CartifactId>openai-client-jvm\u003C\u002FartifactId>\n        \u003Cversion>4.1.0\u003C\u002Fversion>\n    \u003C\u002Fdependency>\n            \n    \u003Cdependency>\n        \u003CgroupId>io.ktor\u003C\u002FgroupId>\n        \u003CartifactId>ktor-client-okhttp-jvm\u003C\u002FartifactId>\n        \u003Cversion>3.0.0\u003C\u002Fversion>\n        \u003Cscope>runtime\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n## 基本使用\n\n### 1. 初始化客户端\n\n推荐使用环境变量存储密钥以确保安全。\n\n```kotlin\nimport com.aallam.openai.api.OpenAI\nimport com.aallam.openai.api.logging.LogLevel\nimport kotlinx.coroutines.time.Timeout\nimport kotlin.time.Duration.Companion.seconds\n\n\u002F\u002F 方式 A：直接传入 Token\nval openai = OpenAI(\n    token = \"your-api-key\", \n    timeout = Timeout(socket = 60.seconds),\n    logging = LogLevel.None \u002F\u002F 生产环境建议关闭日志或设为 Body\u002FHeaders 以便调试\n)\n\n\u002F\u002F 方式 B：使用配置对象\nval config = OpenAIConfig(\n    token = System.getenv(\"OPENAI_API_KEY\"), \u002F\u002F 从环境变量读取\n    timeout = Timeout(socket = 60.seconds)\n)\nval openai = OpenAI(config)\n```\n\n### 2. 调用 Chat 接口示例\n\n```kotlin\nimport com.aallam.openai.api.chat.ChatCompletionRequest\nimport com.aallam.openai.api.chat.ChatMessage\nimport com.aallam.openai.api.chat.ChatRole\n\nsuspend fun main() {\n    val request = ChatCompletionRequest(\n        model = \"gpt-3.5-turbo\",\n        messages = listOf(\n            ChatMessage(role = ChatRole.User, content = \"你好，请用中文介绍你自己。\")\n        )\n    )\n\n    val response = openai.chatCompletion(request)\n    println(response.choices.first().message.content)\n    \n    openai.close() \u002F\u002F 使用完毕后关闭客户端\n}\n```\n\n### 支持的核心功能\n- **Chat**: 对话补全 (`chatCompletion`)\n- **Models**: 模型列表 (`models`)\n- **Images**: 图像生成 (`imageGeneration`)\n- **Embeddings**: 向量嵌入 (`embeddings`)\n- **Audio**: 语音转文字\u002F文字转语音 (`audioTranscription`, `audioSpeech`)\n- **Assistants (Beta)**: 助手、线程与消息管理","某安卓开发团队正在构建一款支持多端（Android、iOS、Web）的智能客服应用，需要深度集成 OpenAI 的对话与图像生成能力。\n\n### 没有 openai-kotlin 时\n- **重复造轮子成本高**：团队需手动封装 HTTP 请求来处理复杂的 JSON 序列化，为每个平台单独编写网络层代码，导致开发周期延长。\n- **协程支持缺失**：原生网络库难以无缝对接 Kotlin 协程，回调地狱频发，主线程阻塞风险高，影响应用流畅度。\n- **类型安全无保障**：API 响应依赖动态解析，缺乏编译期检查，字段拼写错误或数据结构变更往往在运行时才暴露，引发崩溃。\n- **多平台维护困难**：无法共享核心逻辑，Android 和 iOS 端的 AI 功能实现不一致，测试与迭代工作量翻倍。\n\n### 使用 openai-kotlin 后\n- **开箱即用集成**：通过简单的 Gradle 依赖引入，直接调用类型安全的 `chat` 或 `images` 接口，无需手写底层网络代码，开发效率提升 50%。\n- **原生协程体验**：完美支持 Kotlin 协程，开发者可使用标准的 `suspend` 函数异步调用 API，代码简洁且彻底避免主线程卡顿。\n- **编译期错误拦截**：所有请求参数与响应数据均为强类型模型，重构或升级 API 时编译器自动报错，显著降低线上故障率。\n- **一次编写多端运行**：利用 Multiplatform 特性，同一套 AI 业务逻辑可复用于 Android、iOS 及 Web 端，确保功能一致并大幅减少维护成本。\n\nopenai-kotlin 让 Kotlin 开发者能以 idiomatic（地道）的方式高效、安全地在多平台项目中落地先进的 AI 能力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faallam_openai-kotlin_ffe3d5b8.png","aallam","Mouaad Aallam","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Faallam_d62d039b.jpg","Sr. Software Engineer. \r\nBuilding stuff. Sometimes it even works.","@algolia","Paris, France",null,"https:\u002F\u002Fgithub.com\u002Faallam",[24],{"name":25,"color":26,"percentage":27},"Kotlin","#A97BFF",100,1824,235,"2026-04-06T10:57:59","MIT",2,"未说明",{"notes":35,"python":36,"dependencies":37},"这是一个用于 OpenAI API 的 Kotlin 客户端库，而非本地运行的 AI 模型，因此不需要 GPU、大内存或 Python 环境。它支持 Kotlin 多平台（JVM, JS, Native 等），但在 JVM 上使用时必须额外添加一个 Ktor HTTP 引擎依赖（如 ktor-client-okhttp）。构建工具推荐使用 Gradle（支持多平台），Maven 仅支持 JVM 且不支持 BOM 管理。运行时需要有效的 OpenAI API Key。","不适用 (基于 Kotlin\u002FJVM)",[38,39],"com.aallam.openai:openai-client:4.1.0","io.ktor:ktor-client-okhttp (或其他 Ktor 引擎)",[41,42,43,44,45,46],"语言模型","音频","插件","Agent","开发框架","数据工具",[48,49,50,51,52,53,54,55,56,57,58],"openai","kotlin","client","multiplatform","coroutines","api","chatgpt","dall-e","llm","whisper","gpt","ready","2026-03-27T02:49:30.150509","2026-04-07T22:58:26.662999",[63,68,73,78,83,87],{"id":64,"question_zh":65,"answer_zh":66,"source_url":67},22834,"在使用 Gemini OpenAI API 时遇到 'Field id is required' 错误怎么办？","这是因为 Google 模型（如 Gemini）的流式响应中 'id' 字段可能缺失。需要修改 `ChatCompletionChunk` 类，将 `id` 字段设置为可空（nullable）。\n\n解决方案代码示例：\n```kotlin\n@Serializable\npublic data class ChatCompletionChunk(\n    @SerialName(\"id\") public val id: String? = null, \u002F\u002F 将 id 设为可空\n    @SerialName(\"created\") public val created: Long,\n    @SerialName(\"model\") public val model: ModelId,\n    @SerialName(\"choices\") public val choices: List\u003CChatChunk>,\n    \u002F\u002F 其他字段...\n)\n```\n请确保同时更新了流式处理相关的块（streaming chunk）定义。","https:\u002F\u002Fgithub.com\u002Faallam\u002Fopenai-kotlin\u002Fissues\u002F412",{"id":69,"question_zh":70,"answer_zh":71,"source_url":72},22835,"Android 发布版本（Release Build）使用 R8 混淆时报错 'Serializer for class ChatCompletionRequest is not found' 如何解决？","这是由于 R8 混淆移除了序列化所需的元数据。需要在 `proguard-rules.pro` 文件中添加特定的保留规则。\n\n有效的配置如下：\n```proguard\n-keepattributes InnerClasses\n-if @kotlinx.serialization.Serializable class com.aallam.openai.api.**{static **$* *;}\n-keepnames class \u003C1>$$serializer {static \u003C1>$$serializer INSTANCE;}\n```\n或者尝试更具体的保留规则：\n```proguard\n-keep class com.aallam.openai.api.chat.ChatCompletionRequest* { *; }\n-keep class com.aallam.openai.api.chat.ChatCompletion* { *; }\n```\n添加后重新构建发布版 APK 即可解决。","https:\u002F\u002Fgithub.com\u002Faallam\u002Fopenai-kotlin\u002Fissues\u002F156",{"id":74,"question_zh":75,"answer_zh":76,"source_url":77},22836,"该库是否支持 OpenAI 新发布的 Assistant API、JSON 模式和多模态功能？","是的，这些新功能已在版本 **3.6.0** 中得到支持。包括：\n- Assistant API\n- 响应中的 JSON 模式 (Json mode)\n- 多模态 GPT-4 API (Multimodal gpt-4)\n\n请将依赖升级到 3.6.0 或更高版本以使用这些功能：\n`implementation \"com.aallam.openai:openai-client:3.6.0\"` (或更新版本)","https:\u002F\u002Fgithub.com\u002Faallam\u002Fopenai-kotlin\u002Fissues\u002F252",{"id":79,"question_zh":80,"answer_zh":81,"source_url":82},22837,"如何在 Android 项目中正确引入最新的库修复或功能？","如果遇到旧版本无法使用新功能（如 gpt-4o 模型）或包含已知 Bug 的情况，请确保将 `build.gradle` 中的库版本升级到最新稳定版。\n\n例如，如果 3.7.3 之前的版本有问题，请尝试升级到 **3.8.1** 或检查是否有更新的发布版本：\n```groovy\nimplementation \"com.aallam.openai:openai-client:3.8.1\" \u002F\u002F 或最新版本\n```\n注意：某些旧版本 API 可能不支持最新模型（如 gpt-4o），升级通常能解决此类兼容性错误。","https:\u002F\u002Fgithub.com\u002Faallam\u002Fopenai-kotlin\u002Fissues\u002F356",{"id":84,"question_zh":85,"answer_zh":86,"source_url":77},22838,"该库是否支持 OpenAI 的语音生成（Create Speech \u002F TTS）功能？","是的，该功能已被纳入开发计划并得到支持。维护者已确认会添加 \"create speech\" 功能，该功能返回字节数组，可保存为音频文件。\n\n建议检查 **3.6.0** 及之后的版本文档或 Release Notes，通常此类核心功能会在大版本更新中跟进。如果当前版本未找到，请升级到最新版库。",{"id":88,"question_zh":89,"answer_zh":90,"source_url":82},22839,"使用低版本库调用 gpt-4o 模型时失败，是什么原因？","较低版本的库 API 可能尚未适配新的模型标识或参数结构，导致调用 gpt-4o 等新型号时出错。\n\n解决方法是升级库到最新版本（如 3.8.1 或更高），以确保内部 API 实现与 OpenAI 最新的模型规格兼容。请在 `build.gradle` 中更新依赖版本并重新同步项目。",[92,97,102,107,112,117,122,127,132,137,142,147,152,157,162,167,172,177,182,187],{"id":93,"version":94,"summary_zh":95,"released_at":96},136561,"4.1.0","### 新增\n- **batch**: 使 `OpenAI` 接口扩展 `Batch` 接口 (#433)。\n- **responses**: 添加 Responses API 支持（`create`、`retrieve`、`cancel`、`delete` 以及列出 `input_items`）。\n- **chat**: 添加对 `web_search_options` 请求的支持。\n- **chat**: 在聊天消息负载中公开 `annotations` 和 `reasoning_content`。\n- **chat**: 支持 `required` 工具选择模式 (#429)。\n\n### 修复\n- **chat**: 使 `ChatCompletionRequestBuilder.reasoningEffort`、`store` 和 `maxCompletionTokens` 可配置。\n- **chat**: 通过同时支持原始类型和对象类型的变体，提升 `ChatResponseFormat` 的兼容性。\n- **chat**: 始终编码 `JsonSchema.strict`，包括其默认值 `true` (#430)。\n- **chat**: 为多态的 `ContentPart` 序列化设置显式的 JSON 类型鉴别器。\n- **images**: 稳定图像编辑上传，以实现与实时 API 的兼容性 (#459)。\n- **tests**: 从聊天视觉实时测试中移除不稳定的外部图像 URL 依赖。\n- **tests**: 根据当前 API 行为稳定向量存储实时测试 (#459)。\n\n### 变更\n- **tests**: 使 `openai-client` 的实时 API 测试通过 `OPENAI_LIVE_TESTS=1` 进行选择性启用。\n- **ci**: 将计费的实时测试拆分为一个小型 JVM 启动测试作业和一个独立的完整实时工作流。\n- **docs**: 修复《入门指南》中 RetrievalTool 的使用问题 (#427)。","2026-02-07T21:05:07",{"id":98,"version":99,"summary_zh":100,"released_at":101},136562,"4.0.1","### 新增\n- **chat**: 添加推理力度、最大完成标记数，并存储推理模型支持的选项 (#415)（感谢 @Taewan-P）","2025-02-02T13:13:56",{"id":103,"version":104,"summary_zh":105,"released_at":106},136563,"4.0.0","### 新增\n- WasmJs 目标 (#387)\n- **assistants**：添加结构化响应 (#391)（感谢 @ahmedmirza994）\n- **chat**：添加对结构化输出的支持 (#397)\n- **chat**：将 ChatCompletionRequest 改为数据类 (#399)（感谢 @yunmanger1）\n- **assistant**：添加流式传输功能 (#400)（感谢 @Daltomon）\n\n### 修复\n- **runs**：支持文件搜索工具调用 (#405)（感谢 @averyaube）\n\n### 变更\n- 升级到 Kotlin 2.0 (#387)\n- 将 Ktor 更新至 3.0 (#387)\n\n### 破坏性变更\n- 使用 kotlinx.io 替代 okio (#387)","2025-02-02T12:25:16",{"id":108,"version":109,"summary_zh":110,"released_at":111},136564,"4.0.0-beta01","### 新增\n- WasmJs 目标 (#387)\n- feat(assistants): 添加结构化响应 (#391)（感谢 @ahmedmirza994）\n\n### 变更\n- 升级到 Kotlin 2.0 (#387)\n- 将 Ktor 更新至 3.0 (#387)\n\n### 破坏性变更\n- 使用 kotlinx.io 替代 okio (#387)","2024-10-28T09:22:04",{"id":113,"version":114,"summary_zh":115,"released_at":116},136565,"3.8.2","### 新增\n- **chat**: 添加流式选项 (#363)\n- **chat**: 向 `ChatCompletionRequest` 中添加 `instanceId` 字段 (#359)（感谢 @harishv-collab）\n- **messages**: 将助手工具添加到附件中 (#370)\n- **assistants**: 向 `MessageRequest` 中添加 `attachments.fileId` 字段 (#367)（感谢 @0chil）\n- **runs**: 功能（runs）：在助手运行中添加新字段 (#366)（感谢 @ahmedmirza994）\n\n### 修复\n- **messages**: 为与 OpenAI 兼容的助手更新 `quote` 字段，使其成为可选字段，并支持 FileCitation (#361)（感谢 @AntoDev）\n- **messages**: 在获取线程消息时出现序列化异常 (#369)（感谢 @meroving）","2024-07-20T17:54:13",{"id":118,"version":119,"summary_zh":120,"released_at":121},136566,"3.8.1","## 修复\r\n\r\n- **runs**: 将 beta 头部设置为 v2 (#357)（感谢 @kdman98）\r\n- **chat**: 将 `ChatChunk.finishReason` 的默认值设为 null (#358)（感谢 @Him188）","2024-06-19T08:29:11",{"id":123,"version":124,"summary_zh":125,"released_at":126},136567,"3.8.0","### 新增\n- **assistant**: 为 assistant beta-v2 添加新功能，并增加版本选择选项（感谢 @kdman98）\n- **vector-stores**: 添加向量存储 API (#324)\n- **batch**: 添加批量操作 API (#334)\n\n### 修复\n- **models**: 将 created 和 ownedBy 设置为可空字段 (#332)（感谢 @thiswillbeyourgithub）\n- **chat**: 增强对话流程的取消能力 (#333)\n- **assistants**: Assistant.name 字段设置为可空 (#337)（感谢 @Gama11）\n- **chat**: 添加 Azure OpenAI 内容过滤支持 (#340)（感谢 @asharab）\n- **config**: 请求选项中的 headers 会覆盖之前的值 (#353)\n- **runs**: 修复获取运行记录时排序参数的序列化问题 (#355)","2024-06-18T08:38:33",{"id":128,"version":129,"summary_zh":130,"released_at":131},136568,"3.7.2","### 新增\n- **embeddings**: 添加嵌入的 `dimensions` 请求字段 (#317)（感谢 @EliasJorgensen）\n- **chat**: 添加 `logprob` 和 `topLogprobs` (#328)（感谢 @jkohls-indeed）\n\n### 修复\n- **chat**: `image_url` 的内容类型 (#321)\n- **images**: 移除 `Quality` 类型别名 (#318)（感谢 @florentine-doemges）","2024-04-28T22:00:14",{"id":133,"version":134,"summary_zh":135,"released_at":136},136569,"3.7.1","### 新增\n\n- **音频**: 添加 `timestampGranularities`（感谢 @mxwell）\n\n### 修复\n\n- **核心**: 使 `OpenAIErrorDetails` 中的字段可为空 (#315)\n- **消息**: 支持将内容作为图片文件发送 (#313)","2024-04-01T20:51:57",{"id":138,"version":139,"summary_zh":140,"released_at":141},136570,"3.7.0","### 新增\n- 添加 `RequestOptions` (#296)\n\n### 修复\n- **聊天**：在 `ChatCompletionChunk` 中添加 `systemFingerprint` (#303)\n- **聊天**：将 `description` 移至 `FunctionTool` (#304)\n- **聊天**：使 `FunctionTool#Parameters` 可为空 (#304)\n- **微调**：使 `ErrorInfo#message` 和 `ErrorInfo#code` 可为空 (#304)\n- **图像**：修正 `Quality` 包名 (#302)（感谢 @voqaldev）\n- **助手**：文件端点 (#298)（感谢 @rjeeb）\n- **运行**：`RunRequest` 构建器","2024-02-11T18:48:16",{"id":143,"version":144,"summary_zh":145,"released_at":146},136571,"3.6.3","### Added\r\n- **Images**: add `quality` and `style` fields (#292)\r\n- **Runs**: add `additionalInstructions` property to `RunRequest` (#293) (thanks @ahmedmirza994) \r\n\r\n### Fixed\r\n- **Messages**:  `MessageFile` optional fields (#290)\r\n- **proguard**: Add `EnclosingMethod` proguard rule (thanks @rafsanjani)","2024-01-13T12:45:08",{"id":148,"version":149,"summary_zh":150,"released_at":151},136572,"3.6.2","### Fixed\r\n- **Completion**: `Choice.finishReason` as nullable (#285)\r\n- **Chat**: `ChatCompletion.created` field change type from `Int` to `Long` (#282) (thanks @VarenytsiaMykhailo)\r\n- **Runs**: incorrect property name `Run.cancelledAt` (#279) (thanks @Gama11)\r\n- **Proguard**: add `EnclosingMethod` rule (#283) (thanks @rafsanjani)","2023-12-15T12:22:26",{"id":153,"version":154,"summary_zh":155,"released_at":156},136573,"3.6.1","### Fixed\r\n- **Runs**: `ToolCalls`, `ToolCallStep` and `RunSteps` serialization (#266, #269, #271, #273) (thanks @voqaldev)\r\n- **Messages**: `MessageContent` serialization (#275)\r\n","2023-11-26T15:19:07",{"id":158,"version":159,"summary_zh":160,"released_at":161},136574,"3.6.0","_This release represents a significant update to the library. Following OpenAI DevDay 2023, it introduces a range of new features and improvements, including new APIs and multimodal capabilities._\r\n\r\n### Added\r\n- **Images**: Support for model selection for `ImageCreation`, `ImageEdit` and `ImageVariations` (#257) (thanks @FilipObornik)\r\n- **Chat**: add tool calls (#256)\r\n- **Chat**: add vision feature (#258)\r\n- **Config**: adding ktor engine config to support Kotlin Scripting (#261) (thanks @DevSrSouza)\r\n- **Audio**: add speech-to-text (#263)\r\n\r\n#### Beta\r\n- **Assistants**: api implementation (#259)\r\n- **Threads**: api implementation (#262)\r\n- **Messages**: api implementation (#262)\r\n- **Runs**: api implementation (#262)","2023-11-24T18:07:21",{"id":163,"version":164,"summary_zh":165,"released_at":166},136575,"3.5.1","### Fix\r\n- **Models**: permission field nullable (#251)\r\n\r\n### Experimental\r\n- **Chat**: add `mergeToChatMessage` extension (#250)","2023-11-05T18:13:04",{"id":168,"version":169,"summary_zh":170,"released_at":171},136576,"3.5.0","### Added\r\n- *Fine-tuning*: API implementation (#242)\r\n\r\n### Deprecated\r\n- *Fine-tunes* is deprecated","2023-10-04T10:02:16",{"id":173,"version":174,"summary_zh":175,"released_at":176},136577,"3.4.2","### Added\r\n- **Config**: Allow custom ktor http client configuration (#239) (Thanks @rasharab)","2023-09-28T09:49:27",{"id":178,"version":179,"summary_zh":180,"released_at":181},136578,"3.4.1","### Fix\r\n- **Chat**: fix(chat): `FunctionCall` nullable name\u002Farguments (#232)","2023-08-31T11:49:03",{"id":183,"version":184,"summary_zh":185,"released_at":186},136579,"3.4.0","### Added\r\n- Introduced `Parameters.Empty` for functions without parameters.\r\n- Added `File.statusDetails` for retrieving file status details.\r\n- `HyperParams` new fields: `computeClassificationMetrics`, `classificationNClasses` and `classificationPositiveClass`.\r\n- **Moderation**: update categories and scores.\r\n\r\n### Removed\r\n- Removed *beta* status from the chat and audio features.\r\n\r\n### Deprecated\r\n- `completions` is deprecated.\r\n- `edits` as legacy.\r\n\r\n### Breaking Changes\r\n- **Audio**: Updated `TranscriptionRequest`'s `responseFormat` type to `AudioResponseFormat`.\r\n- **Fine Tune**: set `HyperParams.learningRateMultiplier` to be non-nullable.\r\n- **Edit**: `Choice.finishReason` type to `FinishReason`.\r\n- **Chat**: Multiple changes have been implemented:\r\n  - Set `index`, `message`, and `finishReason` fields in `ChatChoice` to be non-nullable.\r\n  - Set `index`, `delta`, and `finishReason` fields in `ChatChunk` to be non-nullable.\r\n  - Set `ChatCompletionFunction.parameters` to be non-nullable.\r\n  - In `FunctionCall`, set `name`, `arguments`, and `argumentsAsJson()` to be non-nullable.\r\n  - Modified `ChatChoice.finishReason` and `ChatChunk.finishReason` types to `FinishReason`.\r\n","2023-08-24T21:35:24",{"id":188,"version":189,"summary_zh":190,"released_at":191},136580,"3.3.2","### Fix\r\n- **Audio**: `Segment#transient` property nullable (thanks @charlee-dev)\r\n\r\n### Dependencies\r\n- Kotlin to `1.9.0`\r\n- Kotlin coroutines to `1.7.2`\r\n- Kotlin serialization to `1.5.1`\r\n- ktor to `2.3.2`\r\n- okio to `3.4.0`","2023-07-21T22:04:42",[193,203,211,219,227,235],{"id":194,"name":195,"github_repo":196,"description_zh":197,"stars":198,"difficulty_score":199,"last_commit_at":200,"category_tags":201,"status":59},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[44,45,202,46],"图像",{"id":204,"name":205,"github_repo":206,"description_zh":207,"stars":208,"difficulty_score":199,"last_commit_at":209,"category_tags":210,"status":59},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[45,202,44],{"id":212,"name":213,"github_repo":214,"description_zh":215,"stars":216,"difficulty_score":32,"last_commit_at":217,"category_tags":218,"status":59},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",143909,"2026-04-07T11:33:18",[45,44,41],{"id":220,"name":221,"github_repo":222,"description_zh":223,"stars":224,"difficulty_score":32,"last_commit_at":225,"category_tags":226,"status":59},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[45,202,44],{"id":228,"name":229,"github_repo":230,"description_zh":231,"stars":232,"difficulty_score":32,"last_commit_at":233,"category_tags":234,"status":59},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[43,45],{"id":236,"name":237,"github_repo":238,"description_zh":239,"stars":240,"difficulty_score":199,"last_commit_at":241,"category_tags":242,"status":59},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[41,202,44,45]]