[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81619":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":14,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":15,"rankGlobal":10,"rankLanguage":10,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":17,"hasPages":17,"topics":19,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":13,"starSnapshotCount":13,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},81619,"deepseek-kit","FliPPeDround\u002Fdeepseek-kit","FliPPeDround","The DeepSeek-native Agent Framework","https:\u002F\u002Fdeepseek-kit.vercel.app",null,"TypeScript",22,0,1,40,"MIT License",false,"main",[20,21,22],"agent","deepseek","framework","2026-06-12 04:01:34","\u003Cimg src=\"logo.png\" align=\"right\" width=\"77\" alt=\"logo\"\u002F>\n\n# deepseek-kit\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![bundle][bundle-src]][bundle-href]\n[![JSDocs][jsdocs-src]][jsdocs-href]\n[![License][license-src]][license-href]\n\nA lightweight Agent framework with native-level DeepSeek adaptation — Precise tool calling in thinking mode · Reliable structured output · Maximum cache hit rate.\n\n**[中文文档](.\u002FREADME.zh-CN.md)** · **[Documentation](https:\u002F\u002Fdeepseek-kit.vercel.app)**\n\n---\n\n## 🚀 Quick Experience\n\n**Try it online** — no local setup needed:\n\n[![Open in StackBlitz](https:\u002F\u002Fdeveloper.stackblitz.com\u002Fimg\u002Fopen_in_stackblitz.svg)](https:\u002F\u002Fstackblitz.com\u002Fgithub\u002FFliPPeDround\u002Fdeepseek-kit\u002Ftree\u002Fmain\u002Fstackblitz)\n\n**Or scaffold a project locally:**\n\n```bash\npnpx create deepseek-kit my-agent\n```\n\n---\n\n## Why deepseek-kit?\n\nLangChain.js and AI SDK are excellent general-purpose frameworks, but DeepSeek's API has unique mechanisms that they cannot properly handle. deepseek-kit is built from the ground up to solve these problems.\n\n### 🧠 Precise Tool Calling in Thinking Mode\n\nDeepSeek's thinking mode outputs a chain of thought (`reasoning_content`) before the final answer. When the model makes tool calls during thinking, **all subsequent requests must include the full `reasoning_content`** — otherwise the API returns a 400 error.\n\nGeneral-purpose frameworks cannot distinguish between the different handling requirements for `reasoning_content` in \"with tool call\" vs \"without tool call\" scenarios, causing multi-turn tool calling to fail frequently.\n\n**deepseek-kit** automatically tracks and re-sends `reasoning_content` in the agent loop, applies differentiated strategies based on whether tool calls occurred, and enables thinking mode by default — zero configuration needed.\n\n### 💾 Maximum Cache Hit Rate\n\nDeepSeek API enables context hard disk caching by default. When subsequent requests have a **prefix that exactly matches** a previous request, the repeated portion is served from cache, significantly reducing latency and cost.\n\nGeneral-purpose frameworks often inject dynamic metadata (timestamps, request IDs) or arrange messages in non-deterministic order, breaking prefix consistency and causing cache hit rates to plummet.\n\n**deepseek-kit** sends zero-redundancy request bodies with deterministic message construction, ensuring the same input always produces the same request prefix. Cache hit rates are fully observable via `prompt_cache_hit_tokens` and `prompt_cache_miss_tokens`.\n\n### 📋 Reliable Structured Output\n\nStructured output is essential for agent applications, but under DeepSeek's thinking mode, general-purpose frameworks' structured output solutions often conflict with `reasoning_content` management, resulting in unreliable output formats.\n\n**deepseek-kit** provides Zod Schema-driven structured output with smart retry and formatted error feedback, fully compatible with thinking mode — the chain-of-thought context is never lost during formatting steps.\n\n---\n\n## Features\n\n- 🧠 **Thinking Mode Adaptation** — Automatic `reasoning_content` management, zero-config tool calling chains\n- 💾 **Cache Hit Rate Optimization** — Zero-redundancy request body + deterministic message construction\n- 📋 **Structured Output** — Zod Schema-driven, smart retry, thinking mode compatible\n- 🤖 **Agent System** — Build intelligent agents with tool calling and multi-step execution\n- 🌿 **Subagents** — Encapsulate agents as tools for delegation, with isolated context and parallel execution\n- 💬 **Streaming** — Streaming events for text, chain-of-thought, and tool calls\n- 🔧 **Tool Calling** — Built-in tool definition, parameter validation, timeout, and retry\n- ✍️ **FIM Completion** — Fill-in-the-Middle code completion support\n- 🪝 **Hook System** — Insert custom logic before and after generation steps\n- 🔄 **Auto Retry** — Smart retry strategy with exponential backoff and jitter\n- 🌲 **Tree-shakable** — Pure ESM, `sideEffects: false`\n- 🔒 **Type Safe** — Complete TypeScript type definitions\n\n---\n\n## Quick Start\n\n```bash\npnpm add deepseek-kit\n```\n\n```ts\nimport { createAgent, createModel, tool } from 'deepseek-kit'\nimport { z } from 'zod'\n\nconst model = createModel({ model: 'deepseek-v4-flash' })\n\nconst weatherTool = tool({\n  name: 'get_weather',\n  description: 'Get weather information for a city',\n  schema: z.object({\n    city: z.string().describe('City name'),\n  }),\n  execute: async ({ city }) => `${city}: Sunny, 25°C`,\n})\n\nconst agent = createAgent({ model, tools: [weatherTool] })\n\nconst result = await agent.generate({\n  prompt: 'How\\'s the weather in Chongqing today?',\n})\n\nconsole.log(result.text)\n```\n\n> **Requirements**: Node.js >= 18.0.0, DeepSeek API key\n\n📖 For the full guide, visit the [documentation](https:\u002F\u002Fdeepseek-kit.vercel.app).\n\n---\n\n## 🙇🏻‍♂️ Sponsors\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fafdian.com\u002Fa\u002Fflippedround\">\n    \u003Cimg alt=\"sponsors\" src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FFliPPeDround\u002Fsponsors\u002Fsponsorkit\u002Fsponsors.svg\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n## License\n\n[MIT](.\u002FLICENSE.md) License © [Flippedround](https:\u002F\u002Fgithub.com\u002Fflippedround)\n\n\u003C!-- Badges -->\n\n[npm-version-src]: https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fdeepseek-kit?style=flat&colorA=080f12&colorB=1fa669\n[npm-version-href]: https:\u002F\u002Fnpmx.dev\u002Fpackage\u002Fdeepseek-kit\n[npm-downloads-src]: https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fdeepseek-kit?style=flat&colorA=080f12&colorB=1fa669\n[npm-downloads-href]: https:\u002F\u002Fnpmx.dev\u002Fpackage\u002Fdeepseek-kit\n[bundle-src]: https:\u002F\u002Fimg.shields.io\u002Fbundlephobia\u002Fminzip\u002Fdeepseek-kit?style=flat&colorA=080f12&colorB=1fa669&label=minzip\n[bundle-href]: https:\u002F\u002Fbundlephobia.com\u002Fresult?p=deepseek-kit\n[license-src]: https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fflippedround\u002Fdeepseek-kit.svg?style=flat&colorA=080f12&colorB=1fa669\n[license-href]: https:\u002F\u002Fgithub.com\u002Fflippedround\u002Fdeepseek-kit\u002Fblob\u002Fmain\u002FLICENSE\n[jsdocs-src]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fjsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669\n[jsdocs-href]: https:\u002F\u002Fwww.jsdocs.io\u002Fpackage\u002Fdeepseek-kit\n","deepseek-kit 是一个专为 DeepSeek API 设计的轻量级 Agent 框架。它具备精准的工具调用、可靠的结构化输出以及最大化缓存命中率的核心功能。通过自动追踪和重发 reasoning_content，该框架能够无缝处理思考模式下的多轮工具调用问题；同时，采用确定性消息构建策略确保请求前缀一致性，从而提高缓存效率；此外，还支持基于 Zod Schema 的智能重试与格式化错误反馈机制，保证了输出的可靠性。deepseek-kit 适用于需要利用 DeepSeek 特性进行复杂对话或任务处理的应用场景，如智能客服、虚拟助手等。",2,"2026-06-11 04:05:43","CREATED_QUERY"]