[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-huggingface--llm-vscode":3,"tool-huggingface--llm-vscode":64},[4,17,27,35,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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 真正成长为懂上",151918,2,"2026-04-12T11:33:05",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":10,"last_commit_at":23,"category_tags":24,"status":16},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[25,14,26,13],"插件","图像",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":10,"last_commit_at":33,"category_tags":34,"status":16},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",[25,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":41,"last_commit_at":42,"category_tags":43,"status":16},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,3,"2026-04-06T11:19:32",[15,26,14,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":10,"last_commit_at":58,"category_tags":59,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85092,"2026-04-10T11:13:16",[26,60,61,25,14,62,15,13,63],"数据工具","视频","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":75,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":95,"env_os":96,"env_gpu":97,"env_ram":98,"env_deps":99,"category_tags":106,"github_topics":79,"view_count":10,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":107,"updated_at":108,"faqs":109,"releases":140},6883,"huggingface\u002Fllm-vscode","llm-vscode","LLM powered development for VSCode","llm-vscode 是一款专为 Visual Studio Code 打造的智能编程扩展，旨在利用大语言模型（LLM）提升开发效率。它核心解决了开发者在编码过程中需要快速获得代码补全建议、减少重复劳动以及灵活选择 AI 模型的需求。无论是希望体验类似 GitHub Copilot“幽灵文本”实时补全功能的工程师，还是想要自由切换不同后端服务的研究人员，都能从中受益。\n\n该工具的最大亮点在于其高度的灵活性与隐私保护意识。它不绑定单一模型，支持通过 Hugging Face Inference API、Ollama、OpenAI 兼容接口或本地 Text Generation Inference 等多种后端运行，让用户既能使用云端强大模型，也能在本地部署私有模型以确保数据安全。此外，llm-vscode 具备独特的代码溯源功能，一键即可检测生成的代码是否源自公开数据集，帮助团队规避潜在的版权风险。同时，它能智能调整输入上下文长度，确保始终适配模型的窗口限制，避免报错。对于希望在 VS Code 中深度集成可控、透明且高效 AI 辅助编程能力的开发者而言，这是一个值得信赖的开源选择。","# LLM powered development for VSCode\n\n**llm-vscode** is an extension for all things LLM. It uses [**llm-ls**](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-ls) as its backend.\n\nWe also have extensions for:\n* [neovim](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm.nvim)\n* [jupyter](https:\u002F\u002Fgithub.com\u002Fbigcode-project\u002Fjupytercoder)\n* [intellij](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-intellij)\n\nPreviously **huggingface-vscode**.\n\n> [!NOTE]\n> When using the Inference API, you will probably encounter some limitations. Subscribe to the *PRO* plan to avoid getting rate limited in the free tier.\n>\n> https:\u002F\u002Fhuggingface.co\u002Fpricing#pro\n\n## Features\n\n### Code completion\n\nThis plugin supports \"ghost-text\" code completion, à la Copilot.\n\n### Choose your model\n\nRequests for code generation are made via an HTTP request.\n\nYou can use the Hugging Face [Inference API](https:\u002F\u002Fhuggingface.co\u002Finference-api) or your own HTTP endpoint, provided it adheres to the APIs listed in [backend](#backend).\n\nThe list of officially supported models is located in the config template section.\n\n### Always fit within the context window\n\nThe prompt sent to the model will always be sized to fit within the context window, with the number of tokens determined using [tokenizers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftokenizers).\n\n### Code attribution\n\nHit `Cmd+shift+a` to check if the generated code is in [The Stack](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fbigcode\u002Fthe-stack).\nThis is a rapid first-pass attribution check using [stack.dataportraits.org](https:\u002F\u002Fstack.dataportraits.org).\nWe check for sequences of at least 50 characters that match a Bloom filter.\nThis means false positives are possible and long enough surrounding context is necesssary (see the [paper](https:\u002F\u002Fdataportraits.org\u002F) for details on n-gram striding and sequence length).\n[The dedicated Stack search tool](https:\u002F\u002Fhf.co\u002Fspaces\u002Fbigcode\u002Fsearch) is a full dataset index and can be used for a complete second pass. \n\n## Installation\n\nInstall like any other [vscode extension](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=HuggingFace.huggingface-vscode).\n\nBy default, this extension uses [bigcode\u002Fstarcoder](https:\u002F\u002Fhuggingface.co\u002Fbigcode\u002Fstarcoder) & [Hugging Face Inference API](https:\u002F\u002Fhuggingface.co\u002Finference-api) for the inference.\n\n#### HF API token\n\nYou can supply your HF API token ([hf.co\u002Fsettings\u002Ftoken](https:\u002F\u002Fhf.co\u002Fsettings\u002Ftoken)) with this command:\n1. `Cmd\u002FCtrl+Shift+P` to open VSCode command palette\n2. Type: `Llm: Login`\n\nIf you previously logged in with `huggingface-cli login` on your system the extension will read the token from disk.\n\n## Configuration\n\nYou can check the full list of configuration settings by opening your settings page (`cmd+,`) and typing `Llm`.\n\n### Backend\n\nYou can configure the backend to which requests will be sent. **llm-vscode** supports the following backends:\n- `huggingface`: The Hugging Face Inference API (default)\n- `ollama`: [Ollama](https:\u002F\u002Follama.com)\n- `openai`: any OpenAI compatible API (e.g. [llama-cpp-python](https:\u002F\u002Fgithub.com\u002Fabetlen\u002Fllama-cpp-python))\n- `tgi`: [Text Generation Inference](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftext-generation-inference)\n\nLet's say your current code is this:\n```py\nimport numpy as np\nimport scipy as sp\n{YOUR_CURSOR_POSITION}\ndef hello_world():\n    print(\"Hello world\")\n```\n\nThe request body will then look like:\n```js\nconst inputs = `{start token}import numpy as np\\nimport scipy as sp\\n{end token}def hello_world():\\n    print(\"Hello world\"){middle token}`\nconst data = { inputs, ...configuration.requestBody };\n\nconst model = configuration.modelId;\nlet endpoint;\nswitch(configuration.backend) {\n    \u002F\u002F cf URL construction\n    let endpoint = build_url(configuration);\n}\n\nconst res = await fetch(endpoint, {\n    body: JSON.stringify(data),\n    headers,\n    method: \"POST\"\n});\n\nconst json = await res.json() as { generated_text: string };\n```\n\nNote that the example above is a simplified version to explain what is happening under the hood.\n\n#### URL construction\n\nThe endpoint URL that is queried to fetch suggestions is build the following way:\n- depending on the backend, it will try to append the correct path to the base URL located in the configuration (e.g. `{url}\u002Fv1\u002Fcompletions` for the `openai` backend)\n- if no URL is set for the `huggingface` backend, it will automatically use the default URL\n  - it will error for other backends as there is no sensible default URL\n- if you do set the **correct** path at the end of the URL it will not add it a second time as it checks if it is already present\n- there is an option to disable this behavior: `llm.disableUrlPathCompletion`\n\n### Suggestion behavior\n\nYou can tune the way the suggestions behave:\n- `llm.enableAutoSuggest` lets you choose to enable or disable \"suggest-as-you-type\" suggestions.\n- `llm.documentFilter` lets you enable suggestions only on specific files that match the pattern matching syntax you will provide. The object must be of type [`DocumentFilter | DocumentFilter[]`](https:\u002F\u002Fmicrosoft.github.io\u002Flanguage-server-protocol\u002Fspecifications\u002Flsp\u002F3.17\u002Fspecification\u002F#documentFilter):\n  - to match on all types of buffers: `llm.documentFilter: { pattern: \"**\" }`\n  - to match on all files in `my_project\u002F`: `llm.documentFilter: { pattern: \"\u002Fpath\u002Fto\u002Fmy_project\u002F**\" }`\n  - to match on all python and rust files: `llm.documentFilter: { pattern: \"**\u002F*.{py,rs}\" }`\n\n### Keybindings\n\n**llm-vscode** sets two keybindings:\n* you can trigger suggestions with `Cmd+shift+l` by default, which corresponds to the `editor.action.inlineSuggest.trigger` command\n* [code attribution](#code-attribution) is set to `Cmd+shift+a` by default, which corresponds to the `llm.attribution` command\n\n### [**llm-ls**](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-ls)\n\nBy default, **llm-ls** is bundled with the extension. When developing locally or if you built your own binary because your platform is not supported, you can set the `llm.lsp.binaryPath` setting to the path of the binary.\n\n### Tokenizer\n\n**llm-ls** uses [**tokenizers**](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftokenizers) to make sure the prompt fits the `context_window`.\n\nTo configure it, you have a few options:\n* No tokenization, **llm-ls** will count the number of characters instead:\n```json\n{\n  \"llm.tokenizer\": null\n}\n```\n* from a local file on your disk:\n```json\n{\n  \"llm.tokenizer\": {\n    \"path\": \"\u002Fpath\u002Fto\u002Fmy\u002Ftokenizer.json\"\n  }\n}\n```\n* from a Hugging Face repository, **llm-ls** will attempt to download `tokenizer.json` at the root of the repository:\n```json\n{\n  \"llm.tokenizer\": {\n    \"repository\": \"myusername\u002Fmyrepo\",\n    \"api_token\": null,\n  }\n}\n```\nNote: when `api_token` is set to null, it will use the token you set with `Llm: Login` command. If you want to use a different token, you can set it here.\n\n* from an HTTP endpoint, **llm-ls** will attempt to download a file via an HTTP GET request:\n```json\n{\n  \"llm.tokenizer\": {\n    \"url\": \"https:\u002F\u002Fmy-endpoint.example.com\u002Fmytokenizer.json\",\n    \"to\": \"\u002Fdownload\u002Fpath\u002Fof\u002Fmytokenizer.json\"\n  }\n}\n```\n\n### Code Llama\n\nTo test Code Llama 13B model:\n1. Make sure you have the [latest version of this extension](#installing).\n2. Make sure you have [supplied HF API token](#hf-api-token)\n3. Open Vscode Settings (`cmd+,`) & type: `Llm: Config Template`\n4. From the dropdown menu, choose `hf\u002Fcodellama\u002FCodeLlama-13b-hf`\n\nRead more [here](https:\u002F\u002Fhuggingface.co\u002Fblog\u002Fcodellama) about Code LLama.\n\n### Phind and WizardCoder\n\nTo test [Phind\u002FPhind-CodeLlama-34B-v2](https:\u002F\u002Fhf.co\u002FPhind\u002FPhind-CodeLlama-34B-v2) and\u002For [WizardLM\u002FWizardCoder-Python-34B-V1.0](https:\u002F\u002Fhf.co\u002FWizardLM\u002FWizardCoder-Python-34B-V1.0) :\n1. Make sure you have the [latest version of this extension](#installing).\n2. Make sure you have [supplied HF API token](#hf-api-token)\n3. Open Vscode Settings (`cmd+,`) & type: `Llm: Config Template`\n4. From the dropdown menu, choose `hf\u002FPhind\u002FPhind-CodeLlama-34B-v2` or `hf\u002FWizardLM\u002FWizardCoder-Python-34B-V1.0`\n\nRead more about Phind-CodeLlama-34B-v2 [here](https:\u002F\u002Fhuggingface.co\u002FPhind\u002FPhind-CodeLlama-34B-v2) and WizardCoder-15B-V1.0 [here](https:\u002F\u002Fhuggingface.co\u002FWizardLM\u002FWizardCoder-15B-V1.0).\n\n## Developing\n\n1. Clone `llm-ls`: `git clone https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-ls`\n2. Build `llm-ls`: `cd llm-ls && cargo build` (you can also use `cargo build --release` for a release build)\n3. Clone this repo: `git clone https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode`\n4. Install deps: `cd llm-vscode && npm ci`\n5. In vscode, open `Run and Debug` side bar & click `Launch Extension`\n6. In the new vscode window, set the `llm.lsp.binaryPath` setting to the path of the `llm-ls` binary you built in step 2 (e.g. `\u002Fpath\u002Fto\u002Fllm-ls\u002Ftarget\u002Fdebug\u002Fllm-ls`)\n7. Close the window and restart the extension with `F5` or like in `5.`\n\n## Community\n\n| Repository | Description |\n| --- | --- |\n| [huggingface-vscode-endpoint-server](https:\u002F\u002Fgithub.com\u002FLucienShui\u002Fhuggingface-vscode-endpoint-server) | Custom code generation endpoint for this repository |\n| [llm-vscode-inference-server](https:\u002F\u002Fgithub.com\u002Fwangcx18\u002Fllm-vscode-inference-server) | An endpoint server for efficiently serving quantized open-source LLMs for code. |\n","# 基于大语言模型的 VSCode 开发\n\n**llm-vscode** 是一个用于处理所有大语言模型相关功能的扩展。它使用 [**llm-ls**](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-ls) 作为后端。\n\n我们还有以下编辑器的扩展：\n* [neovim](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm.nvim)\n* [jupyter](https:\u002F\u002Fgithub.com\u002Fbigcode-project\u002Fjupytercoder)\n* [intellij](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-intellij)\n\n之前名为 **huggingface-vscode**。\n\n> [!NOTE]\n> 使用推理 API 时，您可能会遇到一些限制。请订阅 *PRO* 方案，以避免在免费层级中被限流。\n>\n> https:\u002F\u002Fhuggingface.co\u002Fpricing#pro\n\n## 功能\n\n### 代码补全\n\n此插件支持类似 Copilot 的“幽灵文本”代码补全功能。\n\n### 选择您的模型\n\n代码生成请求通过 HTTP 请求发送。\n\n您可以使用 Hugging Face 的 [推理 API](https:\u002F\u002Fhuggingface.co\u002Finference-api) 或您自己的 HTTP 端点，前提是该端点符合 [后端](#backend) 中列出的 API 规范。\n\n官方支持的模型列表位于配置模板部分。\n\n### 始终适应上下文窗口\n\n发送给模型的提示始终会调整大小以适应上下文窗口，令牌数量由 [tokenizers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftokenizers) 计算得出。\n\n### 代码归属\n\n按下 `Cmd+shift+a` 可以检查生成的代码是否来自 [The Stack](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fbigcode\u002Fthe-stack)。这是使用 [stack.dataportraits.org](https:\u002F\u002Fstack.dataportraits.org) 进行的快速初步归属检查。我们会查找至少 50 个字符的匹配序列，并使用 Bloom 过滤器进行验证。这意味着可能存在误报，并且需要足够长的上下文（有关 n-gram 步进和序列长度的详细信息，请参阅 [论文](https:\u002F\u002Fdataportraits.org\u002F)）。[专门的 Stack 搜索工具](https:\u002F\u002Fhf.co\u002Fspaces\u002Fbigcode\u002Fsearch) 是完整的数据集索引，可用于进行全面的二次检查。\n\n## 安装\n\n像安装其他 [vscode 扩展](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=HuggingFace.huggingface-vscode) 一样安装即可。\n\n默认情况下，此扩展使用 [bigcode\u002Fstarcoder](https:\u002F\u002Fhuggingface.co\u002Fbigcode\u002Fstarcoder) 和 [Hugging Face 推理 API](https:\u002F\u002Fhuggingface.co\u002Finference-api) 进行推理。\n\n#### HF API 令牌\n\n您可以通过以下命令提供您的 HF API 令牌（[hf.co\u002Fsettings\u002Ftoken](https:\u002F\u002Fhf.co\u002Fsettings\u002Ftoken))：\n1. 按下 `Cmd\u002FCtrl+Shift+P` 打开 VSCode 命令面板\n2. 输入：`Llm: Login`\n\n如果您之前已在系统上使用 `huggingface-cli login` 登录过，扩展将从磁盘读取令牌。\n\n## 配置\n\n您可以通过打开设置页面 (`cmd+,`) 并输入 `Llm` 来查看完整的配置选项列表。\n\n### 后端\n\n您可以配置请求将被发送到的后端。**llm-vscode** 支持以下后端：\n- `huggingface`: Hugging Face 推理 API（默认）\n- `ollama`: [Ollama](https:\u002F\u002Follama.com)\n- `openai`: 任何兼容 OpenAI 的 API（例如 [llama-cpp-python](https:\u002F\u002Fgithub.com\u002Fabetlen\u002Fllama-cpp-python)）\n- `tgi`: [Text Generation Inference](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftext-generation-inference)\n\n假设您当前的代码如下：\n```py\nimport numpy as np\nimport scipy as sp\n{YOUR_CURSOR_POSITION}\ndef hello_world():\n    print(\"Hello world\")\n```\n\n请求体将如下所示：\n```js\nconst inputs = `{start token}import numpy as np\\nimport scipy as sp\\n{end token}def hello_world():\\n    print(\"Hello world\"){middle token}`\nconst data = { inputs, ...configuration.requestBody };\n\nconst model = configuration.modelId;\nlet endpoint;\nswitch(configuration.backend) {\n    \u002F\u002F cf URL construction\n    let endpoint = build_url(configuration);\n}\n\nconst res = await fetch(endpoint, {\n    body: JSON.stringify(data),\n    headers,\n    method: \"POST\"\n});\n\nconst json = await res.json() as { generated_text: string };\n```\n\n请注意，以上示例是为了说明底层工作原理而简化的版本。\n\n#### URL 构建\n\n用于获取建议的端点 URL 按照以下方式构建：\n- 根据后端的不同，它会尝试将正确的路径附加到配置中指定的基 URL 上（例如，对于 `openai` 后端，为 `{url}\u002Fv1\u002Fcompletions`）。\n- 如果未为 `huggingface` 后端设置 URL，则会自动使用默认 URL。\n  - 对于其他后端，如果没有合理的默认 URL，则会报错。\n- 如果您在 URL 结尾设置了**正确**的路径，它不会再次添加，因为会先检查该路径是否已存在。\n- 您可以禁用此行为：`llm.disableUrlPathCompletion`。\n\n### 建议行为\n\n您可以调整建议的行为方式：\n- `llm.enableAutoSuggest` 允许您启用或禁用“边键入边建议”的功能。\n- `llm.documentFilter` 允许您仅对符合您提供的模式匹配语法的特定文件启用建议。对象必须是 [`DocumentFilter | DocumentFilter[]`](https:\u002F\u002Fmicrosoft.github.io\u002Flanguage-server-protocol\u002Fspecifications\u002Flsp\u002F3.17\u002Fspecification\u002F#documentFilter) 类型：\n  - 匹配所有类型的缓冲区：`llm.documentFilter: { pattern: \"**\" }`\n  - 匹配 `my_project\u002F` 中的所有文件：`llm.documentFilter: { pattern: \"\u002Fpath\u002Fto\u002Fmy_project\u002F**\" }`\n  - 匹配所有 Python 和 Rust 文件：`llm.documentFilter: { pattern: \"**\u002F*.{py,rs}\" }`\n\n### 快捷键\n\n**llm-vscode** 设置了两个快捷键：\n* 默认情况下，您可以按 `Cmd+shift+l` 触发建议，这对应于 `editor.action.inlineSuggest.trigger` 命令。\n* 默认情况下，[代码归属](#code-attribution) 被设置为 `Cmd+shift+a`，这对应于 `llm.attribution` 命令。\n\n### [**llm-ls**](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-ls)\n\n默认情况下，**llm-ls** 与扩展一起打包。如果您在本地开发或由于平台不受支持而自行构建了二进制文件，可以将 `llm.lsp.binaryPath` 设置为二进制文件的路径。\n\n### 分词器\n\n**llm-ls** 使用 [**tokenizers**](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftokenizers) 来确保提示符适合 `context_window`。\n\n要配置它，您有几种选择：\n* 不进行分词，**llm-ls** 将改用字符数计算：\n```json\n{\n  \"llm.tokenizer\": null\n}\n```\n* 从您磁盘上的本地文件：\n```json\n{\n  \"llm.tokenizer\": {\n    \"path\": \"\u002Fpath\u002Fto\u002Fmy\u002Ftokenizer.json\"\n  }\n}\n```\n* 从 Hugging Face 仓库，**llm-ls** 会尝试下载仓库根目录下的 `tokenizer.json`：\n```json\n{\n  \"llm.tokenizer\": {\n    \"repository\": \"myusername\u002Fmyrepo\",\n    \"api_token\": null,\n  }\n}\n```\n注意：当 `api_token` 设置为 null 时，它将使用您通过 `Llm: Login` 命令设置的令牌。如果您想使用不同的令牌，可以在这里设置。\n\n* 从 HTTP 端点，**llm-ls** 会尝试通过 HTTP GET 请求下载文件：\n```json\n{\n  \"llm.tokenizer\": {\n    \"url\": \"https:\u002F\u002Fmy-endpoint.example.com\u002Fmytokenizer.json\",\n    \"to\": \"\u002Fdownload\u002Fpath\u002Fof\u002Fmytokenizer.json\"\n  }\n}\n```\n\n### Code Llama\n\n要测试 Code Llama 13B 模型：\n1. 确保您已安装[此扩展的最新版本](#installing)。\n2. 确保您已提供[HF API 令牌](#hf-api-token)。\n3. 打开 VSCode 设置（`cmd+,`），输入：`Llm: Config Template`。\n4. 在下拉菜单中，选择 `hf\u002Fcodellama\u002FCodeLlama-13b-hf`。\n\n更多关于 Code Llama 的信息，请参阅[此处](https:\u002F\u002Fhuggingface.co\u002Fblog\u002Fcodellama)。\n\n### Phind 和 WizardCoder\n\n要测试 [Phind\u002FPhind-CodeLlama-34B-v2](https:\u002F\u002Fhf.co\u002FPhind\u002FPhind-CodeLlama-34B-v2) 和\u002F或 [WizardLM\u002FWizardCoder-Python-34B-V1.0](https:\u002F\u002Fhf.co\u002FWizardLM\u002FWizardCoder-Python-34B-V1.0)：\n1. 确保您已安装[此扩展的最新版本](#installing)。\n2. 确保您已提供[HF API 令牌](#hf-api-token)。\n3. 打开 VSCode 设置（`cmd+,`），输入：`Llm: Config Template`。\n4. 在下拉菜单中，选择 `hf\u002FPhind\u002FPhind-CodeLlama-34B-v2` 或 `hf\u002FWizardLM\u002FWizardCoder-Python-34B-V1.0`。\n\n有关 Phind-CodeLlama-34B-v2 的更多信息，请参阅[此处](https:\u002F\u002Fhuggingface.co\u002FPhind\u002FPhind-CodeLlama-34B-v2)，而关于 WizardCoder-15B-V1.0 的更多信息则请参阅[此处](https:\u002F\u002Fhuggingface.co\u002FWizardLM\u002FWizardCoder-15B-V1.0)。\n\n## 开发\n\n1. 克隆 `llm-ls`：`git clone https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-ls`。\n2. 构建 `llm-ls`：`cd llm-ls && cargo build`（您也可以使用 `cargo build --release` 进行发布版本构建）。\n3. 克隆本仓库：`git clone https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode`。\n4. 安装依赖：`cd llm-vscode && npm ci`。\n5. 在 VSCode 中，打开“运行与调试”侧边栏，并点击“启动扩展”。\n6. 在新的 VSCode 窗口中，将 `llm.lsp.binaryPath` 设置为第 2 步中构建的 `llm-ls` 二进制文件路径（例如 `\u002Fpath\u002Fto\u002Fllm-ls\u002Ftarget\u002Fdebug\u002Fllm-ls`）。\n7. 关闭该窗口，并通过按 `F5` 或按照第 5 步中的方法重新启动扩展。\n\n## 社区\n\n| 仓库 | 描述 |\n| --- | --- |\n| [huggingface-vscode-endpoint-server](https:\u002F\u002Fgithub.com\u002FLucienShui\u002Fhuggingface-vscode-endpoint-server) | 用于本仓库的自定义代码生成端点 |\n| [llm-vscode-inference-server](https:\u002F\u002Fgithub.com\u002Fwangcx18\u002Fllm-vscode-inference-server) | 一个用于高效服务量化开源代码模型的端点服务器。 |","# llm-vscode 快速上手指南\n\n**llm-vscode** 是一款专为 VSCode 设计的 LLM 驱动开发扩展，提供类似 GitHub Copilot 的“幽灵文本”代码补全功能。它基于 `llm-ls` 后端，支持连接 Hugging Face Inference API、Ollama、OpenAI 兼容接口及本地 TGI 服务。\n\n## 环境准备\n\n*   **系统要求**：已安装 Visual Studio Code 的 Windows、macOS 或 Linux 系统。\n*   **前置依赖**：\n    *   无额外系统级依赖（扩展默认 bundled `llm-ls` 二进制文件）。\n    *   若需使用 Hugging Face 模型，建议注册 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002F) 账号并获取 API Token。\n    *   *注意*：免费版的 Inference API 存在速率限制，高频使用建议订阅 PRO 计划或部署本地后端（如 Ollama）。\n\n## 安装步骤\n\n1.  **通过市场安装（推荐）**\n    打开 VSCode，点击左侧扩展图标（或按 `Ctrl+Shift+X` \u002F `Cmd+Shift+X`），搜索 `llm-vscode` (或 `Hugging Face`)，点击 **Install**。\n    \n    或者直接访问插件市场页面：[HuggingFace.huggingface-vscode](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=HuggingFace.huggingface-vscode)\n\n2.  **配置 API Token**\n    安装完成后，需配置 Hugging Face Token 以启用默认模型：\n    *   按下 `Cmd+Shift+P` (macOS) 或 `Ctrl+Shift+P` (Windows\u002FLinux) 打开命令面板。\n    *   输入并选择：`Llm: Login`。\n    *   按提示粘贴你的 HF API Token（可从 [hf.co\u002Fsettings\u002Ftoken](https:\u002F\u002Fhuggingface.co\u002Fsettings\u002Ftoken) 获取）。\n    *   *提示*：如果你已在终端通过 `huggingface-cli login` 登录，扩展会自动读取本地缓存的 Token。\n\n## 基本使用\n\n### 1. 启用代码补全\n默认情况下，扩展使用 `bigcode\u002Fstarcoder` 模型并通过 Hugging Face Inference API 提供服务。\n*   **自动触发**：在编辑器中输入代码时，会自动出现灰色的建议代码（幽灵文本）。按 `Tab` 键即可接受建议。\n*   **手动触发**：若未自动出现，可按默认快捷键 `Cmd+Shift+L` (macOS) 或 `Ctrl+Shift+L` (Windows\u002FLinux) 强制触发建议。\n\n### 2. 切换模型（例如使用 Code Llama）\n想要尝试更强大的模型（如 Code Llama 13B）：\n1.  打开设置：`Cmd+,` 或 `Ctrl+,`。\n2.  搜索 `Llm: Config Template`。\n3.  在下拉菜单中选择预设模型，例如：`hf\u002Fcodellama\u002FCodeLlama-13b-hf`。\n4.  其他可选热门模型：\n    *   `hf\u002FPhind\u002FPhind-CodeLlama-34B-v2`\n    *   `hf\u002FWizardLM\u002FWizardCoder-Python-34B-V1.0`\n\n### 3. 代码归属检查\n怀疑生成的代码可能源自开源数据集？\n*   选中生成的代码片段。\n*   按下 `Cmd+Shift+A` (macOS) 或 `Ctrl+Shift+A` (Windows\u002FLinux)。\n*   系统将快速检查该代码是否存在于 [The Stack](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fbigcode\u002Fthe-stack) 数据集中。\n\n### 4. 高级配置：使用本地后端 (Ollama)\n若希望完全本地运行以避开网络限制或速率限制：\n1.  确保已安装并运行 [Ollama](https:\u002F\u002Follama.com)。\n2.  打开 VSCode 设置 (`Cmd+,` \u002F `Ctrl+,`)，搜索 `Llm`。\n3.  找到 `Llm: Backend` 选项，将其设置为 `ollama`。\n4.  在 `Llm: Model Id` 中填入你本地运行的模型名称（例如 `codellama`）。\n5.  确保 `Llm: Url` 指向本地服务（通常为 `http:\u002F\u002Flocalhost:11434`，具体视后端路径构建规则而定，OpenAI 兼容模式通常需追加 `\u002Fv1\u002Fcompletions`）。","数据科学家小李正在 VS Code 中编写一个复杂的科学计算脚本，需要频繁调用 NumPy 和 SciPy 库处理高维矩阵运算。\n\n### 没有 llm-vscode 时\n- 每次编写新的矩阵变换逻辑时，必须切换浏览器搜索官方文档或 Stack Overflow，打断编码心流。\n- 手动输入冗长的 API 参数（如 `scipy.sparse` 的具体配置）极易出错，导致反复调试类型不匹配问题。\n- 担心直接复制网络代码引发版权纠纷，缺乏快速验证代码来源是否属于开源数据集的手段。\n- 本地部署大模型门槛高，若不使用付费的 Copilot 服务，只能依靠静态提示补全，无法理解上下文逻辑。\n\n### 使用 llm-vscode 后\n- 直接在编辑器内获得“幽灵文本”式代码补全，llm-vscode 基于当前导入的 `numpy` 和 `scipy` 上下文，自动推荐准确的矩阵运算代码。\n- 支持灵活切换后端（如 Ollama 或 Hugging Face Inference API），既能免费使用 StarCoder 等专用模型，又能确保请求内容适配上下文窗口限制。\n- 按下快捷键即可对生成的代码片段进行归属权检查，快速确认其是否源自 The Stack 数据集，降低合规风险。\n- 无需离开 IDE 即可通过自定义 HTTP 端点调用私有化部署模型，既保护了敏感数据处理逻辑，又获得了智能生成能力。\n\nllm-vscode 将大模型的原生推理能力无缝融入开发工作流，让开发者在保持专注的同时享受智能化编码与合规保障。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhuggingface_llm-vscode_67b4d5b7.png","huggingface","Hugging Face","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fhuggingface_90da21a4.png","The AI community building the future.",null,"https:\u002F\u002Fhuggingface.co\u002F","https:\u002F\u002Fgithub.com\u002Fhuggingface",[83,87],{"name":84,"color":85,"percentage":86},"TypeScript","#3178c6",91.8,{"name":88,"color":89,"percentage":90},"JavaScript","#f1e05a",8.2,1315,142,"2026-04-08T16:52:18","Apache-2.0",1,"Windows, macOS, Linux","非必需（取决于后端选择）。若使用本地部署的 Ollama、TGI 或 llama-cpp-python 等后端，则需根据所选模型配置相应的 GPU；若使用默认的 Hugging Face Inference API 或 OpenAI 兼容接口，则无需本地 GPU。","未说明（取决于是否本地运行模型及模型大小）",{"notes":100,"python":101,"dependencies":102},"该工具是 VS Code 扩展，默认后端为 Hugging Face Inference API（云端），因此本地无需安装 Python 环境或深度学习框架。若用户选择切换至本地后端（如 Ollama、TGI、llama-cpp-python），则需自行安装并配置对应服务的环境依赖（如 Rust、CUDA、Python 库等）。默认捆绑了 llm-ls 后端二进制文件，若平台不支持可手动编译。支持通过配置文件选择不同的大模型（如 StarCoder, CodeLlama, Phind 等）。","未说明",[103,104,105],"llm-ls (内置二进制文件)","tokenizers","Node.js (用于扩展开发)",[15,25],"2026-03-27T02:49:30.150509","2026-04-12T21:59:45.123264",[110,115,120,125,130,135],{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},31021,"如何在 Windows 上解决自定义代码补全服务器的路径错误（os error 123）？","该问题已在 `0.5.x` 版本中修复。请确保将 llm-vscode 扩展更新到 0.5.x 或更高版本，即可解决 Windows 特有的文件名、目录名或驱动器标签语法错误问题。","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode\u002Fissues\u002F92",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},31022,"如何配置扩展以使用本地运行的 Ollama 或 llama.cpp (CodeLlama)？","扩展已添加了对 Ollama 和 OpenAI 的适配器支持（参见 PR #117）。请确保更新到包含这些修复的最新版本（如 0.5.0 及以上）。更新后，您可以在设置中配置相应的后端以连接本地运行的模型服务。","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode\u002Fissues\u002F60",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},31023,"遇到 'Inference api error: Service Unavailable' 或 'relative URL without a base' 错误如何解决？","这通常是由于配置不完整导致的。您需要在 `settings.json` 中明确指定端点 URL、后端类型和模型 ID。示例配置如下：\n```json\n{\n    \"llm.url\": \"https:\u002F\u002F\u003Cendpoint-id>.us-east-1.aws.endpoints.huggingface.cloud\",\n    \"llm.backend\": \"tgi\",\n    \"llm.modelId\": \"bigcode\u002Fstarcoder2-15b\",\n    \"llm.requestBody\": {\n        \"parameters\": {\n            \"max_new_tokens\": 60,\n            \"temperature\": 0.2,\n            \"top_p\": 0.95\n        }\n    }\n}\n```\n注意：`attributionEndpoint` 设置仅用于代码归属检查，与实际补全请求的端点无关。","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode\u002Fissues\u002F137",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},31024,"如何在 API 请求中添加自定义头部（例如用于身份验证）？","您可以运行 `llm.login` 命令。该命令会读取 `~\u002F.cache\u002Fhuggingface\u002Ftoken` 文件中的令牌，或者提示您输入令牌并将其存储在秘密存储区中。输入的令牌将自动作为 `Authorization` 头发送，格式为：`Authorization: Bearer \u003Cvalue>`。","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode\u002Fissues\u002F114",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},31025,"在 Jupyter Notebook 中使用扩展时出现 'failed to find document' 错误怎么办？","这是一个已知限制。该错误不仅发生在未保存的文件上，也发生在具有特殊引用的文档上，例如 Jupyter Notebook 的单元格（vscode-notebook-cell）。目前扩展主要支持存储在磁盘上的普通文件，对 Notebook 单元格的支持尚不完善。","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode\u002Fissues\u002F77",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},31026,"是否支持 LlamaCpp 后端？","是的，LlamaCpp 的支持已经通过底层库 `llm-ls` 的更新（PR #94）合并。该功能将在 `llm-vscode` 发布新版本后可用。请关注扩展的更新以启用此功能。","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fllm-vscode\u002Fissues\u002F132",[141],{"id":142,"version":143,"summary_zh":144,"released_at":145},222926,"v0.1.0","* VS Code 插件的重大重构\n  * 已从 Tabnine 分支迁移\n* 集成 llm-ls\n* CI","2023-09-26T13:27:46"]