[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-eth-sri--lmql":3,"tool-eth-sri--lmql":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},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",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",148568,2,"2026-04-09T23:34:24",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108111,"2026-04-08T11:23:26",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},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",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},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",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":108,"forks":109,"last_commit_at":110,"license":111,"difficulty_score":32,"env_os":112,"env_gpu":113,"env_ram":114,"env_deps":115,"category_tags":122,"github_topics":123,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":128,"updated_at":129,"faqs":130,"releases":160},6989,"eth-sri\u002Flmql","lmql","A language for constraint-guided and efficient LLM programming.","LMQL 是一门专为大型语言模型（LLM）设计的编程语言，它基于 Python 的超集构建，让开发者能像编写普通代码一样自然地调用和控制大模型。传统开发中，将大模型能力融入程序往往依赖繁琐的模板拼接，难以精确控制输出格式或逻辑流程。LMQL 通过原生集成解决了这一痛点，允许在代码中直接嵌入提示词，并利用 `where` 关键字为模型生成内容施加严格的约束（如停止条件、数据类型），从而实现对模型推理过程的精准引导。\n\n除了基础的线性脚本，LMQL 还支持束搜索（beam search）等高级解码算法，并完美兼容 Python 的条件判断、循环等控制流结构，使复杂的“算法逻辑 + 模型推理”混合编程变得简洁高效。无论是需要构建复杂智能体应用的 AI 工程师，还是希望探索可控文本生成的研究人员，都能利用 LMQL 提升开发效率与实验灵活性。配合其提供的浏览器端 Playground IDE 和丰富的示例库，用户可以快速上手，轻松将大模型的强大能力转化为稳定可靠的程序逻辑。","\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Flmql.ai\">\n    \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Feth-sri\u002Flmql\u002Fweb\u002Flmql.svg\" alt=\"Logo\" width=\"80\" height=\"80\">\n  \u003C\u002Fa>\n\n  \u003Ch3 align=\"center\">LMQL\u003C\u002Fh3>\n\n  \u003Cp align=\"center\">\n    A programming language for large language models.\n    \u003Cbr \u002F>\n    \u003Ca href=\"https:\u002F\u002Flmql.ai\u002Fdocs\">\u003Cstrong>Documentation »\u003C\u002Fstrong>\u003C\u002Fa>\n    \u003Cbr \u002F>\n    \u003Cbr \u002F>\n    \u003Ca href=\"https:\u002F\u002Flmql.ai\">Explore Examples\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Flmql.ai\u002Fplayground\">Playground IDE\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fissues\">Report Bug\u003C\u002Fa>\n    \u003Cbr\u002F>\n    \u003Cbr\u002F>\n    \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002F7eJP4fcyNT\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1091288833997410414?style=plastic&logo=discord&color=blueviolet&logoColor=white\" height=18\u002F>\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FLmql\">\u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FLmql.svg?cacheSeconds=3600\" alt=\"PyPI version\" height=18>\u003C\u002Fa>\n  \u003C\u002Fp>\n\u003C\u002Fdiv>\n\n\nLMQL is a programming language for large language models (LLMs) based on a *superset of Python*. LMQL offers a novel way of interweaving traditional programming with the ability to call LLMs in your code. It goes beyond traditional templating languages by integrating LLM interaction natively at the level of your program code. \n\n> \u003Cimg width=\"200pt\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feth-sri_lmql_readme_57f2934d1988.png\"> \u003Cbr\u002F>Help us shape the next major version of LMQL by filling out the LMQL developer survey: https:\u002F\u002Fforms.gle\u002FpGvAicNpUhS1rAkK9\n\n\n## Explore LMQL\n\nAn LMQL program reads like standard Python, but top-level strings are interpreted as query strings: They are passed to an LLM, where template variables like `[GREETINGS]` are automatically completed by the model:\n\n```python\n\"Greet LMQL:[GREETINGS]\\n\" where stops_at(GREETINGS, \".\") and not \"\\n\" in GREETINGS\n\nif \"Hi there\" in GREETINGS:\n    \"Can you reformulate your greeting in the speech of \\\n     victorian-era English: [VIC_GREETINGS]\\n\" where stops_at(VIC_GREETINGS, \".\")\n\n\"Analyse what part of this response makes it typically victorian:\\n\"\n\nfor i in range(4):\n    \"-[THOUGHT]\\n\" where stops_at(THOUGHT, \".\")\n\n\"To summarize:[SUMMARY]\"\n```\n\nProgram Output:\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feth-sri_lmql_readme_6a1a71a82bb7.png\"\u002F>\n  \u003Cbr\u002F>\n\u003C\u002Fdiv>\n\nLMQL allows you to express programs that contain both, traditional algorithmic logic, and LLM calls. \nAt any point during execution, you can prompt an LLM on program variables in combination with standard natural language prompting, to leverage model reasoning capabilities in the context of your program.\n\nTo better control LLM behavior, you can use the `where` keyword to specify constraints and data types of the generated text. This enables guidance of the model's reasoning process, and constraining of intermediate outputs using an [expressive constraint language](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fconstraints.html).\n\nBeyond this linear form of scripting, LMQL also supports a number of decoding algorithms to execute your program, such as `argmax`, `sample` or even advanced branching decoders like [beam search and `best_k`](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fdecoding.html). \n\nLearn more about LMQL by exploring thne **[Example Showcase](https:\u002F\u002Flmql.ai)**, by running your own programs in our **[browser-based Playground IDE](https:\u002F\u002Flmql.ai\u002Fplayground)** or by reading the **[documentation](https:\u002F\u002Flmql.ai\u002Fdocs)**.\n\n## Feature Overview\n\nLMQL is designed to make working with language models like OpenAI and 🤗 Transformers more efficient and powerful through its advanced functionality, including multi-variable templates, conditional distributions, constraints, datatypes and control flow.\n\n- [X] **Python Syntax**: Write your queries using [familiar Python syntax](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Foverview.html), fully integrated with your Python environment (classes, variable captures, etc.)\n- [X] **Rich Control-Flow**: LMQL offers full Python support, enabling powerful [control flow and logic](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fscripted-prompting.html) in your prompting logic.\n- [X] **Advanced Decoding**: Take advantage of advanced decoding techniques like [beam search, best_k, and more](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fdecoding.html).\n- [X] **Powerful Constraints Via Logit Masking**: Apply [constraints to model output](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fconstraints.html), e.g. to specify token length, character-level constraints, datatype and stopping phrases to get more control of model behavior.\n- [X] **Optimizing Runtime:** LMQL leverages speculative execution to enable faster inference, constraint short-circuiting, more efficient token use and [tree-based caching](https:\u002F\u002Flmql.ai\u002Fblog\u002Frelease-0.0.6.html).\n- [X] **Sync and Async API**: Execute hundreds of queries in parallel with LMQL's [asynchronous API](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flib\u002Fpython.html), which enables cross-query batching.\n- [X] **Multi-Model Support**: Seamlessly use LMQL with [OpenAI API, Azure OpenAI, and 🤗 Transformers models](https:\u002F\u002Flmql.ai\u002Fdocs\u002Fmodels\u002F).\n- [X] **Extensive Applications**: Use LMQL to implement advanced applications like [schema-safe JSON decoding](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fguidance#guaranteeing-valid-syntax-json-example-notebook), [algorithmic prompting](https:\u002F\u002Ftwitter.com\u002Flbeurerkellner\u002Fstatus\u002F1648076868807950337), [interactive chat interfaces](https:\u002F\u002Ftwitter.com\u002Flmqllang\u002Fstatus\u002F1645776209702182917), and [inline tool use](https:\u002F\u002Flmql.ai\u002F#kv).\n- [X] **Library Integration**: Easily employ LMQL in your existing stack leveraging [LangChain](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flib\u002Fintegrations\u002Flangchain.html) or [LlamaIndex](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flib\u002Fintegrations\u002Fllama_index.html).\n- [X] **Flexible Tooling**: Enjoy an interactive development experience with [LMQL's Interactive Playground IDE](https:\u002F\u002Flmql.ai\u002Fplayground), and [Visual Studio Code Extension](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=lmql-team.lmql).\n- [X] **Output Streaming**: Stream model output easily via [WebSocket, REST endpoint, or Server-Sent Event streaming](https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fblob\u002Fmain\u002Fsrc\u002Flmql\u002Foutput\u002F).\n\n## Getting Started\n\nTo install the latest version of LMQL run the following command with Python ==3.10 installed.\n\n```\npip install lmql\n```\n\n**Local GPU Support:** If you want to run models on a local GPU, make sure to install LMQL in an environment with a GPU-enabled installation of PyTorch >= 1.11 (cf. https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F) and install via `pip install lmql[hf]`.\n\n## Running LMQL Programs\n\nAfter installation, you can launch the LMQL playground IDE with the following command:\n\n```\nlmql playground\n```\n\n> Using the LMQL playground requires an installation of Node.js. If you are in a conda-managed environment you can install node.js via `conda install nodejs=14.20 -c conda-forge`. Otherwise, please see the official Node.js website https:\u002F\u002Fnodejs.org\u002Fen\u002Fdownload\u002F for instructions how to install it on your system.\n\nThis launches a browser-based playground IDE, including a showcase of many exemplary LMQL programs. If the IDE does not launch automatically, go to `http:\u002F\u002Flocalhost:3000`.\n\nAlternatively, `lmql run` can be used to execute local `.lmql` files. Note that when using local HuggingFace Transformers models in the Playground IDE or via `lmql run`, you have to first launch an instance of the LMQL Inference API for the corresponding model via the command `lmql serve-model`.\n\n### Configuring OpenAI API Credentials\n\nIf you want to use OpenAI models, you have to configure your API credentials. To do so you can either define the `OPENAI_API_KEY` environment variable or create a file `api.env` in the active working directory, with the following contents:\n\n```\nopenai-org: \u003Corg identifier>\nopenai-secret: \u003Capi secret>\n```\n\nFor system-wide configuration, you can also create an `api.env` file at `$HOME\u002F.lmql\u002Fapi.env` or at the project root of your LMQL distribution (e.g. `src\u002F` in a development copy).\n\nAlternatively, you can use LMQL-specific env variables `LMQL_OPENAI_SECRET` and `LMQL_OPENAI_ORG`.\n\n## Installing the Latest Development Version\n\nTo install the latest (bleeding-edge) version of LMQL, you can also run the following command:\n\n```\npip install git+https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\n```\n\nThis will install the `lmql` package directly from the `main` branch of this repository. We do not continously test the `main` version, so it may be less stable than the latest PyPI release.\n\n# Contributing\n\nLMQL is a community-centric project. If you are interested in contributing to LMQL, please see the [contributing guidelines](.\u002FCONTRIBUTING.md) for more information, and reach out to us via [Discord](https:\u002F\u002Fdiscord.gg\u002F7eJP4fcyNT). We are looking forward to your contributions!\n\n## Setting Up a Development Environment\n\nTo setup a `conda` environment for local LMQL development with GPU support, run the following commands:\n\n```\n# prepare conda environment\nconda env create -f scripts\u002Fconda\u002Frequirements.yml -n lmql\nconda activate lmql\n\n# registers the `lmql` command in the current shell\nsource scripts\u002Factivate-dev.sh\n```\n\n> **Operating System**: The GPU-enabled version of LMQL was tested to work on Ubuntu 22.04 with CUDA 12.0 and Windows 10 via WSL2 and CUDA 11.7. The no-GPU version (see below) was tested to work on Ubuntu 22.04 and macOS 13.2 Ventura or Windows 10 via WSL2.\n\n### Development without GPU\n\nThis section outlines how to setup an LMQL development environment without local GPU support. Note that LMQL without local GPU support only supports the use of API-integrated models like `openai\u002Ftext-davinci-003`. Please see the OpenAI API documentation (https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels\u002Fgpt-3-5) to learn more about the set of available models.\n\nTo setup a `conda` environment for LMQL with no GPU support, run the following commands:\n\n```\n# prepare conda environment\nconda env create -f scripts\u002Fconda\u002Frequirements-no-gpu.yml -n lmql-no-gpu\nconda activate lmql-no-gpu\n\n# registers the `lmql` command in the current shell\nsource scripts\u002Factivate-dev.sh\n```\n","\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Flmql.ai\">\n    \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Feth-sri\u002Flmql\u002Fweb\u002Flmql.svg\" alt=\"Logo\" width=\"80\" height=\"80\">\n  \u003C\u002Fa>\n\n  \u003Ch3 align=\"center\">LMQL\u003C\u002Fh3>\n\n  \u003Cp align=\"center\">\n    面向大型语言模型的编程语言。\n    \u003Cbr \u002F>\n    \u003Ca href=\"https:\u002F\u002Flmql.ai\u002Fdocs\">\u003Cstrong>文档 »\u003C\u002Fstrong>\u003C\u002Fa>\n    \u003Cbr \u002F>\n    \u003Cbr \u002F>\n    \u003Ca href=\"https:\u002F\u002Flmql.ai\">探索示例\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Flmql.ai\u002Fplayground\">游乐场 IDE\u003C\u002Fa>\n    ·\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fissues\">报告 bug\u003C\u002Fa>\n    \u003Cbr\u002F>\n    \u003Cbr\u002F>\n    \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002F7eJP4fcyNT\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1091288833997410414?style=plastic&logo=discord&color=blueviolet&logoColor=white\" height=18\u002F>\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FLmql\">\u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FLmql.svg?cacheSeconds=3600\" alt=\"PyPI version\" height=18>\u003C\u002Fa>\n  \u003C\u002Fp>\n\u003C\u002Fdiv>\n\n\nLMQL 是一种基于 *Python 超集* 的大型语言模型（LLM）编程语言。LMQL 提供了一种新颖的方式，将传统编程与在代码中调用 LLM 的能力无缝结合。它超越了传统的模板语言，直接在程序代码层面原生集成 LLM 交互。\n\n> \u003Cimg width=\"200pt\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feth-sri_lmql_readme_57f2934d1988.png\"> \u003Cbr\u002F>请填写 LMQL 开发者调查问卷，帮助我们塑造 LMQL 的下一个主要版本：https:\u002F\u002Fforms.gle\u002FpGvAicNpUhS1rAkK9\n\n\n## 探索 LMQL\n\nLMQL 程序的语法与标准 Python 几乎相同，但顶级字符串会被解释为查询字符串：它们会被传递给 LLM，其中像 `[GREETINGS]` 这样的模板变量会由模型自动补全：\n\n```python\n\"Greet LMQL:[GREETINGS]\\n\" where stops_at(GREETINGS, \".\") and not \"\\n\" in GREETINGS\n\nif \"Hi there\" in GREETINGS:\n    \"Can you reformulate your greeting in the speech of \\\n     victorian-era English: [VIC_GREETINGS]\\n\" where stops_at(VIC_GREETINGS, \".\")\n\n\"Analyse what part of this response makes it typically victorian:\\n\"\n\nfor i in range(4):\n    \"-[THOUGHT]\\n\" where stops_at(THOUGHT, \".\")\n\n\"To summarize:[SUMMARY]\"\n```\n\n程序输出：\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feth-sri_lmql_readme_6a1a71a82bb7.png\"\u002F>\n  \u003Cbr\u002F>\n\u003C\u002Fdiv>\n\nLMQL 允许你编写同时包含传统算法逻辑和 LLM 调用的程序。在执行过程中的任何时刻，你都可以结合标准自然语言提示，对程序变量进行 LLM 提示，从而在你的程序上下文中利用模型的推理能力。\n\n为了更好地控制 LLM 的行为，你可以使用 `where` 关键字来指定生成文本的约束条件和数据类型。这使得你可以引导模型的推理过程，并通过 [表达性约束语言](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fconstraints.html) 来限制中间输出。\n\n除了这种线性脚本形式之外，LMQL 还支持多种解码算法来执行你的程序，例如 `argmax`、`sample`，甚至更高级的分支解码器，如 [束搜索和 `best_k`](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fdecoding.html)。\n\n要深入了解 LMQL，请浏览 **[示例展示](https:\u002F\u002Flmql.ai)**，在我们的 **[基于浏览器的游乐场 IDE](https:\u002F\u002Flmql.ai\u002Fplayground)** 中运行你自己的程序，或阅读 **[文档](https:\u002F\u002Flmql.ai\u002Fdocs)**。\n\n## 功能概览\n\nLMQL 旨在通过其先进的功能，使与 OpenAI 和 🤗 Transformers 等语言模型的合作更加高效和强大，这些功能包括多变量模板、条件分布、约束、数据类型和控制流。\n\n- [X] **Python 语法**：使用 [熟悉的 Python 语法](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Foverview.html) 编写查询，完全集成到你的 Python 环境中（类、变量捕获等）。\n- [X] **丰富的控制流**：LMQL 完全支持 Python，能够在你的提示逻辑中实现强大的 [控制流和逻辑](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fscripted-prompting.html)。\n- [X] **高级解码**：利用 [束搜索、best_k 等高级解码技术](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fdecoding.html)。\n- [X] **强大的日志掩码约束**：对模型输出应用 [约束](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flanguage\u002Fconstraints.html)，例如指定标记长度、字符级约束、数据类型和停止短语，以更好地控制模型行为。\n- [X] **优化运行时**：LMQL 利用推测执行来实现更快的推理、约束短路、更高效的标记使用以及 [基于树的缓存](https:\u002F\u002Flmql.ai\u002Fblog\u002Frelease-0.0.6.html)。\n- [X] **同步与异步 API**：使用 LMQL 的 [异步 API](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flib\u002Fpython.html)，可以并行执行数百个查询，并支持跨查询批处理。\n- [X] **多模型支持**：可无缝地与 [OpenAI API、Azure OpenAI 和 🤗 Transformers 模型](https:\u002F\u002Flmql.ai\u002Fdocs\u002Fmodels\u002F) 一起使用。\n- [X] **广泛应用**：使用 LMQL 实现高级应用，例如 [模式安全的 JSON 解码](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fguidance#guaranteeing-valid-syntax-json-example-notebook)、[算法式提示](https:\u002F\u002Ftwitter.com\u002Flbeurerkellner\u002Fstatus\u002F1648076868807950337)、[交互式聊天界面](https:\u002F\u002Ftwitter.com\u002Flmqllang\u002Fstatus\u002F1645776209702182917)，以及 [内联工具使用](https:\u002F\u002Flmql.ai\u002F#kv)。\n- [X] **库集成**：借助 [LangChain](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flib\u002Fintegrations\u002Flangchain.html) 或 [LlamaIndex](https:\u002F\u002Flmql.ai\u002Fdocs\u002Flib\u002Fintegrations\u002Fllama_index.html)，轻松将 LMQL 应用于现有堆栈。\n- [X] **灵活的工具**：通过 [LMQL 的交互式游乐场 IDE](https:\u002F\u002Flmql.ai\u002Fplayground) 和 [Visual Studio Code 扩展](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=lmql-team.lmql) 享受交互式的开发体验。\n- [X] **输出流式传输**：可通过 [WebSocket、REST 端点或服务器发送事件流](https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fblob\u002Fmain\u002Fsrc\u002Flmql\u002Foutput\u002F) 轻松流式传输模型输出。\n\n## 快速入门\n\n要安装最新版本的 LMQL，请在已安装 Python ==3.10 的环境中运行以下命令。\n\n```\npip install lmql\n```\n\n**本地 GPU 支持：** 如果你想在本地 GPU 上运行模型，请确保在配备 GPU 版 PyTorch >= 1.11 的环境中安装 LMQL（参见 https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F），并使用 `pip install lmql[hf]` 进行安装。\n\n## 运行 LMQL 程序\n\n安装完成后，您可以使用以下命令启动 LMQL 演示 IDE：\n\n```\nlmql playground\n```\n\n> 使用 LMQL 演示 IDE 需要安装 Node.js。如果您在 conda 管理的环境中，可以通过 `conda install nodejs=14.20 -c conda-forge` 安装 Node.js。否则，请访问 Node.js 官方网站 https:\u002F\u002Fnodejs.org\u002Fen\u002Fdownload\u002F，按照说明在您的系统上进行安装。\n\n这将启动一个基于浏览器的演示 IDE，其中包含许多示例 LMQL 程序。如果 IDE 未自动启动，请访问 `http:\u002F\u002Flocalhost:3000`。\n\n此外，您也可以使用 `lmql run` 来执行本地的 `.lmql` 文件。请注意，在演示 IDE 中或通过 `lmql run` 使用本地 HuggingFace Transformers 模型时，您必须先通过命令 `lmql serve-model` 为相应模型启动一个 LMQL 推理 API 实例。\n\n### 配置 OpenAI API 凭证\n\n如果您想使用 OpenAI 模型，需要配置您的 API 凭证。为此，您可以定义 `OPENAI_API_KEY` 环境变量，或者在当前工作目录下创建一个名为 `api.env` 的文件，内容如下：\n\n```\nopenai-org: \u003C组织标识符>\nopenai-secret: \u003CAPI 密钥>\n```\n\n对于系统范围的配置，您还可以在 `$HOME\u002F.lmql\u002Fapi.env` 或 LMQL 发行版的项目根目录（例如开发副本中的 `src\u002F`）中创建 `api.env` 文件。\n\n另外，您也可以使用 LMQL 特定的环境变量 `LMQL_OPENAI_SECRET` 和 `LMQL_OPENAI_ORG`。\n\n## 安装最新开发版本\n\n要安装 LMQL 的最新（前沿）版本，您还可以运行以下命令：\n\n```\npip install git+https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\n```\n\n这将直接从该仓库的 `main` 分支安装 `lmql` 包。我们不会持续测试 `main` 版本，因此它可能不如最新的 PyPI 发布版本稳定。\n\n# 贡献\nLMQL 是一个以社区为中心的项目。如果您有兴趣为 LMQL 做贡献，请参阅 [贡献指南](.\u002FCONTRIBUTING.md) 以获取更多信息，并通过 [Discord](https:\u002F\u002Fdiscord.gg\u002F7eJP4fcyNT) 与我们联系。我们期待您的贡献！\n\n## 设置开发环境\n\n要设置支持 GPU 的本地 LMQL 开发 conda 环境，请运行以下命令：\n\n```\n# 准备 conda 环境\nconda env create -f scripts\u002Fconda\u002Frequirements.yml -n lmql\nconda activate lmql\n\n# 在当前 shell 中注册 `lmql` 命令\nsource scripts\u002Factivate-dev.sh\n```\n\n> **操作系统**：已测试支持 GPU 的 LMQL 版本可在 Ubuntu 22.04 上配合 CUDA 12.0 使用，也可在 Windows 10 的 WSL2 环境中配合 CUDA 11.7 使用。而无 GPU 版本（见下文）则已在 Ubuntu 22.04 和 macOS 13.2 Ventura，以及 Windows 10 的 WSL2 环境中进行了测试。\n\n### 无 GPU 开发\n本节介绍如何设置不使用本地 GPU 的 LMQL 开发环境。请注意，不使用本地 GPU 的 LMQL 仅支持使用集成到 API 中的模型，例如 `openai\u002Ftext-davinci-003`。有关可用模型的详细信息，请参阅 OpenAI API 文档（https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels\u002Fgpt-3-5）。\n\n要设置不使用 GPU 的 LMQL conda 环境，请运行以下命令：\n\n```\n# 准备 conda 环境\nconda env create -f scripts\u002Fconda\u002Frequirements-no-gpu.yml -n lmql-no-gpu\nconda activate lmql-no-gpu\n\n# 在当前 shell 中注册 `lmql` 命令\nsource scripts\u002Factivate-dev.sh\n```","# LMQL 快速上手指南\n\nLMQL 是一种基于 Python 超集的大语言模型（LLM）编程语言。它允许你将传统的编程逻辑与大模型调用无缝结合，通过原生语法控制模型的生成过程、约束输出格式并实现复杂的推理流程。\n\n## 环境准备\n\n在开始之前，请确保你的开发环境满足以下要求：\n\n*   **操作系统**：\n    *   **推荐**：Ubuntu 22.04 (CUDA 12.0) 或 Windows 10 (WSL2 + CUDA 11.7)。\n    *   **无本地 GPU 模式**：支持 Ubuntu 22.04, macOS 13.2+, 或 Windows 10 (WSL2)。此模式下主要使用 OpenAI 等 API 模型。\n*   **Python 版本**：必须安装 **Python 3.10**。\n*   **Node.js**（可选但推荐）：若需使用浏览器版 Playground IDE，需安装 Node.js (推荐 v14.20+)。\n    *   Conda 用户可执行：`conda install nodejs=14.20 -c conda-forge`\n    *   其他用户请访问 [Node.js 官网](https:\u002F\u002Fnodejs.org\u002F) 安装。\n*   **本地 GPU 支持**（可选）：若需在本地运行 HuggingFace 模型，需预先安装支持 GPU 的 PyTorch (>= 1.11)。\n\n## 安装步骤\n\n### 1. 基础安装（适用于调用 OpenAI\u002FAzure API）\n\n使用 pip 安装最新稳定版：\n\n```bash\npip install lmql\n```\n\n> **国内加速提示**：如果下载速度较慢，建议使用国内镜像源：\n> ```bash\n> pip install lmql -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n### 2. 本地 GPU 支持安装（适用于运行本地模型）\n\n如果你需要在本地显卡上运行模型，请确保已安装正确的 PyTorch 版本，然后安装带有 `hf` 扩展的 LMQL：\n\n```bash\npip install lmql[hf]\n```\n\n### 3. 安装最新开发版（可选）\n\n如需体验最新功能（稳定性可能略低）：\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\n```\n\n## 基本使用\n\n### 配置 API 凭证\n\n若使用 OpenAI 模型，需配置密钥。你可以选择以下任一方式：\n\n**方式 A：设置环境变量**\n```bash\nexport OPENAI_API_KEY=\"your_api_key\"\nexport LMQL_OPENAI_ORG=\"your_org_id\" # 可选\n```\n\n**方式 B：创建配置文件**\n在当前工作目录或 `$HOME\u002F.lmql\u002F` 下创建 `api.env` 文件：\n```text\nopenai-org: \u003Corg identifier>\nopenai-secret: \u003Capi secret>\n```\n\n### 运行第一个 LMQL 程序\n\nLMQL 程序看起来像标准的 Python 代码，但顶层的字符串会被视为查询提示词（Prompt），方括号内的变量（如 `[GREETINGS]`）将由模型自动填充。\n\n创建一个名为 `hello.lmql` 的文件，写入以下内容：\n\n```python\n\"Greet LMQL:[GREETINGS]\\n\" where stops_at(GREETINGS, \".\") and not \"\\n\" in GREETINGS\n\nif \"Hi there\" in GREETINGS:\n    \"Can you reformulate your greeting in the speech of \\\n     victorian-era English: [VIC_GREETINGS]\\n\" where stops_at(VIC_GREETINGS, \".\")\n\n\"Analyse what part of this response makes it typically victorian:\\n\"\n\nfor i in range(4):\n    \"-[THOUGHT]\\n\" where stops_at(THOUGHT, \".\")\n\n\"To summarize:[SUMMARY]\"\n```\n\n**运行方式：**\n\n1.  **使用命令行直接运行文件**：\n    ```bash\n    lmql run hello.lmql\n    ```\n    *(注：若使用本地 HuggingFace 模型，需先运行 `lmql serve-model` 启动推理服务)*\n\n2.  **使用交互式 Playground IDE**（推荐新手体验）：\n    启动本地 Web IDE：\n    ```bash\n    lmql playground\n    ```\n    启动后浏览器会自动打开 `http:\u002F\u002Flocalhost:3000`，你可以在其中查看示例、编写代码并实时查看流式输出结果。\n\n### 核心语法简析\n\n*   **变量生成**：`[VAR_NAME]` 标记模型需要生成的内容。\n*   **约束控制**：使用 `where` 关键字限制生成行为，例如 `stops_at(VAR, \".\")` 表示生成到句号停止，或指定数据类型。\n*   **逻辑控制**：完全支持 Python 的 `if`, `for`, 函数调用等逻辑，可根据模型生成的中间结果动态决定后续 Prompt。","某电商数据团队需要每天从成千上万条杂乱的用户评论中，提取结构化的“产品缺陷”与“情感倾向”，并自动过滤掉无关噪音。\n\n### 没有 lmql 时\n- **输出格式不可控**：大模型常自由发挥，生成多余的寒暄语或不合规的 JSON 格式，导致后续解析代码频繁报错。\n- **逻辑割裂严重**：开发者需在 Python 循环、正则表达式和 Prompt 模板间反复切换，难以在生成过程中实时干预模型的推理路径。\n- **约束实现困难**：若想强制模型“只列举 3 条缺点”或“禁止出现特定词汇”，只能依赖脆弱的 Prompt 工程，失败率极高。\n- **调试成本高昂**：一旦中间步骤出错，无法像传统代码那样断点检查变量，只能重新运行整个冗长的生成流程。\n\n### 使用 lmql 后\n- **原生约束保障格式**：利用 `where` 子句直接定义数据类型和停止条件（如 `stops_at`），确保输出严格符合预设结构，无需后置清洗。\n- **算法与生成深度融合**：在标准的 Python 代码流中自然嵌入 LLM 调用，可像操作普通变量一样对模型生成的中间结果进行 `if\u002Felse` 判断。\n- **精准引导推理过程**：通过声明式约束语言，轻松限制生成长度、词汇范围及逻辑分支，让模型严格按业务规则执行任务。\n- **高效迭代与调试**：支持断点查看每一步的生成变量，结合 `beam search` 等高级解码策略，快速定位并优化生成质量。\n\nlmql 将不可控的大模型生成转化为可精确编程、带强约束的逻辑流程，让开发者能像编写传统软件一样可靠地构建 AI 应用。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feth-sri_lmql_6a1a71a8.png","eth-sri","SRI Lab, ETH Zurich","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Feth-sri_3d535846.png","Secure, Reliable, Intelligent Systems Lab, ETH Zurich",null,"https:\u002F\u002Fwww.sri.inf.ethz.ch\u002F","https:\u002F\u002Fgithub.com\u002Feth-sri",[80,84,88,92,96,100,104],{"name":81,"color":82,"percentage":83},"Python","#3572A5",53.7,{"name":85,"color":86,"percentage":87},"Nix","#7e7eff",30.2,{"name":89,"color":90,"percentage":91},"JavaScript","#f1e05a",13.4,{"name":93,"color":94,"percentage":95},"CSS","#663399",1.6,{"name":97,"color":98,"percentage":99},"HTML","#e34c26",0.7,{"name":101,"color":102,"percentage":103},"Shell","#89e051",0.3,{"name":105,"color":106,"percentage":107},"Dockerfile","#384d54",0.1,4165,219,"2026-04-08T16:51:56","Apache-2.0","Linux (Ubuntu 22.04), macOS (13.2 Ventura+), Windows 10 (via WSL2)","非必需。若需本地运行模型，需要支持 CUDA 的 NVIDIA GPU（测试环境：CUDA 12.0 on Linux, CUDA 11.7 on Windows\u002FWSL2）。具体显存大小取决于所选模型，文中未明确指定最低要求。","未说明",{"notes":116,"python":117,"dependencies":118},"1. 基础安装命令为 `pip install lmql`，若需本地 GPU 支持需安装 `pip install lmql[hf]` 并确保环境中已安装支持 GPU 的 PyTorch。\n2. 运行浏览器版 Playground IDE 必须安装 Node.js (推荐 14.20+)。\n3. 使用 OpenAI 模型需配置 API Key（环境变量或 api.env 文件）。\n4. 若在 Playground 或命令行使用本地 HuggingFace 模型，需先通过 `lmql serve-model` 启动推理服务。\n5. 开发环境建议使用 conda 管理，并提供了专门的 GPU 和无 GPU 版本的环境配置文件。","3.10",[119,120,121],"torch>=1.11 (GPU 模式)","transformers (通过 lmql[hf] 安装)","nodejs>=14.20 (用于 Playground IDE)",[35,15],[124,125,126,127],"chatgpt","huggingface","language-model","programming-language","2026-03-27T02:49:30.150509","2026-04-10T15:53:48.710492",[131,136,141,146,151,156],{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},27731,"如何在 LMQL Playground 中配置和使用 Azure OpenAI API？","配置 Azure OpenAI 时，需要在 `lmql.model` 调用中明确指定 `api_type`、`api_base` 和 `api_key`。对于聊天模型使用 'azure-chat'，对于补全模型使用 'azure'。示例代码如下：\n```python\nllm = lmql.model(\n    \"openai\u002F你的部署模型名称\",\n    api_type=\"azure-chat\", \n    api_base=\"https:\u002F\u002F\u003CYOUR_BASE>.openai.azure.com\u002F\",\n    api_key=\"你的 API 密钥\"\n)\n```\n注意：`distribution`（分布概率）功能目前仅适用于 OpenAI 的补全模型（如 text-davinci-003 或 gpt-3.5-turbo-instruct），Azure 上的聊天模型（Chat Models）不支持返回 token 概率，因此无法使用该功能。","https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fissues\u002F248",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},27732,"为什么在使用 llama.cpp 模型时会遇到 'overflow encountered in exp' 错误或 logprob 截断警告？","这通常是因为所有续写 token 的对数概率都低于当前的截断阈值。你可以尝试在 `lmql.model` 中通过 `truncation_threshold` 参数调整阈值（例如设置为更小的负数或根据警告提示调整）。\n此外，该问题可能与 GPU 卸载层数有关。有用户反馈在禁用 GPU 层（即不使用 `--n_gpu_layers` 或设为 0）时运行正常，而开启 GPU 卸载时会出现此问题。如果调整阈值无效，建议尝试在不使用 GPU 加速的情况下运行，或检查模型量化版本兼容性。","https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fissues\u002F135",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},27733,"在 Windows 系统上无法启动 Playground 怎么办？","早期版本在 Windows CMD 中启动 Playground 时会报错 `'REACT_APP_BUILD_COMMIT' is not recognized`。该问题已在主分支修复。现在可以通过以下命令直接在 cmd.exe 中启动 Playground：\n```bash\npython -m lmql.cli playground\n```\n请确保你安装的是包含该修复的最新版本。","https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fissues\u002F4",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},27734,"使用 Azure OpenAI 时必须创建 api.env 文件吗？","不需要。早期版本强制要求存在 `api.env` 文件才能使用 Azure 端点，这是一个已修复的 Bug。在最新版本（0.0.6.6 及以上）中，你可以直接通过 `lmql.model` 的参数传入 Azure 配置，或者仅通过环境变量设置，而无需创建 `api.env` 文件。\n如果仍遇到相关问题，可以尝试创建一个包含虚拟 OpenAI 凭证的 `api.env` 作为临时变通方案，或者直接将 Azure Key 赋值给 `OPENAI_API_KEY` 环境变量。","https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fissues\u002F107",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},27735,"如何在 Python 脚本中正确终止后台运行的模型服务进程？","旧版本的 `serve_model` 实现依赖多进程，导致调用 `terminate()` 时无法正确终止所有子进程。该问题已在最新版本的 `serve-model` 实现中修复，新版本不再依赖多进程结构。\n请升级到最新版本，此时直接使用 `subprocess.Popen` 启动后调用 `terminate()` 即可正常关闭服务。","https:\u002F\u002Fgithub.com\u002Feth-sri\u002Flmql\u002Fissues\u002F13",{"id":157,"question_zh":158,"answer_zh":159,"source_url":135},27736,"LMQL 支持哪些 Azure 模型进行概率分布（distribution）分析？","目前 `distribution` 功能需要模型返回 token 的概率信息。Azure 上的聊天模型（Chat Models，如 gpt-35-turbo）不支持此功能，会提示 \"Chat API models do not support advanced constraining\"。\n若要使用概率分布功能，建议使用 Azure 上的补全模型（Completion Models），例如 `gpt-35-turbo-instruct`（如果可用），或者使用本地部署的模型（local models），因为本地模型的分布评分不需要强大的生成能力且支持该功能。",[161,166,171,176,181,186,191,195,200],{"id":162,"version":163,"summary_zh":164,"released_at":165},188632,"v0.7.3","修复：将 LMQL 聊天 API 所需的资源文件包含在 PyPI 包中。","2023-10-14T16:49:29",{"id":167,"version":168,"summary_zh":169,"released_at":170},188633,"v0.7.2","修复：确保 lmql playground 作为 PyPI 包的一部分一同发布。","2023-10-13T09:25:00",{"id":172,"version":173,"summary_zh":174,"released_at":175},188634,"v0.7.1","这是一个 bug 修复版本，解决了 0.7 中的一些小问题。\n\n* 修复了分布子句和推理追踪相关的问题\n* 使 'random' 模型不再依赖于 chunk_size\n* 优化了自动 chunk_size 选择逻辑，以减少 LLM 调用次数（通过 max_tokens 提示）\n* 支持基于 OpenAI Chat 格式的字典列表进行直接生成","2023-10-12T13:46:56",{"id":177,"version":178,"summary_zh":179,"released_at":180},188635,"v0.7","发布说明：https:\u002F\u002Flmql.ai\u002Fblog\u002Fposts\u002Frelease-0.7.html","2023-10-10T15:09:42",{"id":182,"version":183,"summary_zh":184,"released_at":185},188636,"v0.7b3","这是一个预发布版本，如需最新稳定版，请参考 0.0.6.6。","2023-08-15T15:59:52",{"id":187,"version":188,"summary_zh":189,"released_at":190},188637,"v0.7b2","这是一个预发布版本，如需最新完整版，请参考 0.0.6.6。\n\n* 修复了相应 LMTP 后端中 llama.cpp 的 logits 归一化问题\n* 允许为内置动作函数 `inline_use` 和 `reAct` 设置 `instruct=False`","2023-07-28T18:57:29",{"id":192,"version":193,"summary_zh":76,"released_at":194},188638,"v0.7b1","2023-07-25T15:16:22",{"id":196,"version":197,"summary_zh":198,"released_at":199},188639,"v0.0.6.6","发布说明请见：https:\u002F\u002Flmql.ai\u002Fblog\u002Frelease-0.0.6.6.html","2023-07-25T10:35:59",{"id":201,"version":202,"summary_zh":203,"released_at":204},188640,"v0.0.6.5","请在此处查看发布说明：https:\u002F\u002Flmql.ai\u002Fblog\u002Frelease-0.0.6.5.html","2023-07-14T15:52:43"]