AI Skill Hub 推荐使用:Chak AI 轻量级LLM网关 是一款优质的AI工具。AI 综合评分 7.8 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
一个简洁且实用的开源大模型网关工具,旨在为开发者提供统一的LLM接口管理。它支持多模型调度与请求转发,简化了不同AI服务商的接入流程,非常适合需要快速集成多种大模型且追求轻量化部署的开发者。
Chak AI 轻量级LLM网关 是一款基于 Python 开发的开源工具,专注于 LLM网关、接口统一、Python工具 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
一个简洁且实用的开源大模型网关工具,旨在为开发者提供统一的LLM接口管理。它支持多模型调度与请求转发,简化了不同AI服务商的接入流程,非常适合需要快速集成多种大模型且追求轻量化部署的开发者。
Chak AI 轻量级LLM网关 是一款基于 Python 开发的开源工具,专注于 LLM网关、接口统一、Python工具 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install chak-ai
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install chak-ai
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/zhixiangxue/chak-ai
cd chak-ai
pip install -e .
# 验证安装
python -c "import chak_ai; print('安装成功')"
# 命令行使用
chak-ai --help
# 基本用法
chak-ai input_file -o output_file
# Python 代码中调用
import chak_ai
# 示例
result = chak_ai.process("input")
print(result)
# chak-ai 配置文件示例(config.yml) app: name: "chak-ai" debug: false log_level: "INFO" # 运行时指定配置文件 chak-ai --config config.yml # 或通过环境变量配置 export CHAK_AI_API_KEY="your-key" export CHAK_AI_OUTPUT_DIR="./output"
<a href="https://youtube.com/watch?v=xOKQ7EQcggw"><img src="https://raw.githubusercontent.com/zhixiangxue/chak-ai/main/docs/assets/logo.png" alt="Demo Video" width="120"></a>
A multi-model LLM client with built-in context management and flexible tool calling.
chak is not another liteLLM, one-api, or OpenRouter, but a client library that actively manages conversation context and tool calls for you. Just focus on building your application, let chak handle the complexity.
</div>

</div>
---
fallbacks to route requests through ordered backup LLM providers whenever the current provider fails. Use fallback_on=FallbackOn.RETRYABLE_ERRORS for the conservative timeout/rate-limit/server-error policy. See example..xlsx and .csv spreadsheets. Requires pip install chakpy[tools].move, find, grep methods for full file management.Sandbox built-in tool — run code in an isolated e2b cloud VM. See Built-in Standard Tools.Bash, Python, FileSystem, Web, Search, Http, Pdf. Drop them directly into tools=[] to give any agent baseline capabilities. See Built-in Standard Tools.tool_approval_handler (bool) with hitl_handler (HITLDecision) — three outcomes: abort, allow, allow(overrides={...}). See Human-in-the-Loop.Bash (shell) and Python (code interpreter) for agentic workflows.tool_approval_handler, with CLI and browser/WebSocket support. See Human-in-the-loop Approval in Tool Calling.event=True to observe tool execution in your UI. See Tool Call Observabilitytool_executor parameter to control execution mode. See Tool Callingreturns parameter. See Structured Output---
pip install chakpy[all] ```
| Extra | What it installs |
|---|---|
tools | pymupdf4llm, beautifulsoup4, readability-lxml, ddgs, e2b (and optional API clients for Firecrawl/Tavily) |
server | fastapi, uvicorn, websockets, pyyaml |
web | beautifulsoup4, readability-lxml, firecrawl-py, tavily-python, ddgs |
all | everything above |
```bash
pip install chakpy
Drop in tools, describe your task — chak drives the multi-step loop automatically.
```python import chak from chak.tools.std import Python, FileSystem
conv = chak.Conversation( "anthropic/claude-sonnet-4-6", api_key="...", tools=[Python(), FileSystem()], )
await conv.asend( "Analyse sales.csv: top 10 products by revenue. Write a Markdown report to report.md" )
tools = [MegaSkill()] conv = Conversation("bailian/qwen-plus", tools=tools)
```python from pydantic import BaseModel, Field from chak import Conversation
class User(BaseModel): """User information""" name: str = Field(description="User's full name") email: str = Field(description="User's email address") age: int = Field(description="User's age")
conv = Conversation("openai/gpt-4o", api_key="YOUR_KEY")
See full working examples: - Basic Structured Output: examples/structured_output_simple.py - Multimodal Structured Output: examples/structured_output_multimodal.py
```python from chak import Conversation, Image
conv = Conversation("openai/gpt-4o", api_key="YOUR_KEY")
See full working examples:
```python from chak import Conversation
conv = Conversation("openai/gpt-4o-mini", api_key="YOUR_KEY")
The custom field is completely flexible - use it however your application needs:
Example: examples/custom_payload_demo.py - Demo showing custom data used for dynamic form rendering
---
Control log output at runtime:
import chak
chak.set_log_level("DISABLE") # Disable all logs (production)
chak.set_log_level("ERROR") # Only errors
chak.set_log_level("WARNING") # Warnings + errors
chak.set_log_level("INFO") # Default, shows tool execution
chak.set_log_level("DEBUG") # Detailed logs with file:line
Or use environment variables (set before importing):
export CHAK_LOG_LEVEL=ERROR
export CHAK_LOG_TO_FILE=true # Optional: enable file logging
export CHAK_LOG_FILE=logs/chak.log
⚠️ chak is primarily an SDK. The built-in local server is intended for local development and prototyping only, and is not recommended or hardened for production use.
Start a local gateway service with 2 lines of code:
```yaml
api_keys: # Simple format - use default base_url openai: ${OPENAI_API_KEY} # Read from environment variable (recommended) bailian: "sk-your-api-key-here" # Plain text (for development/testing) # Custom base_url (requires quotes) "ollama@http://localhost:11434": "ollama" "vllm@http://192.168.1.100:8000": "dummy-key"
server: host: "0.0.0.0" port: 8000 ```
No complex configurations, no learning curve. chak is designed to be intuitive:
```python
conv = chak.Conversation( "openai/gpt-4o-mini", api_key="YOUR_KEY", event=True, # Enable event streaming for real-time tool call observability reasoning=True # Enable reasoning mode for compatible models ) response = conv.send("Hello!")
conv = chak.Conversation( "openai/gpt-4o", tools=[...], tool_executor=chak.ToolExecutor.ASYNCIO # default )
response = await conv.asend( "What are the differences between these images?", attachments=[ Image("https://example.com/image1.jpg"), Image("./local/image2.png", MimeType.PNG), Image("data:image/webp;base64,...", MimeType.WEBP) ] )
#### Audio Files
python from chak import Audio, MimeType
response = await conv.asend( "What is being said in this audio?", attachments=[Audio("https://example.com/speech.wav", MimeType.WAV)] )
#### Documents
python from chak import PDF, DOC, Excel, CSV, TXT
response = await conv.asend( "What's in this image?", attachments=[Image("photo.jpg")] # local path, URL, or base64 )
chak-ai 是一个轻量级且功能强大的 AI Agent 开发框架。它旨在简化 LLM Agent 的构建流程,通过直观的接口让开发者能够轻松集成各种工具,实现自动化的多步任务循环,让 AI 不仅仅能对话,更能通过工具执行复杂的实际操作。
最新版本已引入 Notebook 工具,通过内置的 seeka 向量数据库实现 LLM Agent 的持久化记忆,支持跨对话的知识 `note()` 与 `recall()`,无需���外配置外部数据库。此外,框架还具备强大的 Provider 故障转移机制,确保在模型服务不稳定时依然保持业务的韧性。
基础安装仅需 Python 环境。若需使用高级功能,建议通过 `pip install chakpy[all]` 安装所有可选依赖。这包括用于文档解析的 `tools` 扩展(如 pymupdf4llm、beautifulsoup4 等)以及用于构建 Web 服务的 `server` 扩展(如 fastapi、uvicorn 等)。
安装非常简单。基础 SDK 版本可以通过 `pip install chakpy` 直接安装。开发者只需几行代码即可构建一个具备工具调用能力的 Agent,通过指定模型 URI 和工具列表,chak 会自动驱动多步推理循环,实现从任务描述到结果生成的自动化过程。
chak 的设计遵循直觉化原则,工具使用方式与常规工具完全一致。开发者可以像使用普通函数一样定义自定义工具(如 MegaSkill),并将其注入到 Conversation 对象中。同时,框架也支持通过 Pydantic 模型进行结构化数据提取,方便从非结构化文本中精准获取用户信息。
框架提供了灵活的日志控制机制,开发者可以通过 `chak.set_log_level` 在运行时动态调整日志级别,从生产环境的 `DISABLE` 到开发环境的 `DEBUG` 均可覆盖。此外,虽然 chak 主要作为 SDK 使用,但也提供了轻量级的本地 Server 模式,方便开发者进行快速原型开发与本地调试。
chak 采用了极简主义的 API 设计,几乎没有学习成本。开发者可以通过简单的 URI 格式连接任何 LLM(如 `openai/gpt-4o`)。框架原生支持事件流(event streaming)以实现实时工具调用观测,并支持异步 `tool_executor` 模式,非常适合处理 API 调用或数据库查询等 IO 密集型任务。
针对常见问题,chak 支持在发送消息时通过 `attachments` 参数携带图片附件。无论是本地路径、URL 还是 base64 编码,开发者都可以通过 `Image` 类轻松实现多模态交互,让 Agent 具备理解图像内容的能力。
aiskill88点评:定位精准,解决了多模型接入的碎片化痛点,代码简洁,是轻量级AI基础设施的优秀选择。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,Chak AI 轻量级LLM网关 是一款质量良好的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | chak-ai |
| 原始描述 | 开源AI工具:A simple, yet handy, LLM gateway.。⭐203 · Python |
| Topics | LLM网关接口统一Python工具 |
| GitHub | https://github.com/zhixiangxue/chak-ai |
| License | MIT |
| 语言 | Python |
收录时间:2026-07-09 · 更新时间:2026-07-09 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。