Token导航 LogoToken导航TokenDH.com
Llama Chat logo
运维云端未说明官方级别未说明来源级核验

Llama Chat

MCP Server

一个用于通过OpenAI兼容API与本地和联网LLM对话的Rust构建的TUI工具,支持多服务器配置、流式响应和工具调用等功能。

工具数

5

提示词数

0

GitHub Stars

0

资源数

0
LLM交互RustClaudeClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

quinnjr

提供方

quinnjr

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

骆驼聊天

一个类似Claude代码的TUI,用于通过兼容OpenAI的API与本地和网络LLM对话。内置Rust和ratatui。

llama-chat                                         [gemma4:latest] [Spark] [5 tools]
────────────────────────────────────────────────────────────────────────────────────
you: What files are in the current directory?

Reasoning [-] ─
  │ Let me check the current directory contents.
  │ I'll use the list_files tool to see what's there.
  └──────────

⚙ list_files {"path":"."} ✓ allowed
Cargo.toml  src/  tests/  README.md

gemma4:latest: You have 4 entries in the current directory: Cargo.toml, src/,
tests/, and README.md.

you: Create a hello world at /tmp/hello.rs

⚙ write_file {"path":"/tmp/hello.rs","content":"fn main() ..."} ✓ allowed
Wrote 42 bytes to /tmp/hello.rs

gemma4:latest: Done — wrote a hello world program to /tmp/hello.rs.
────────────────────────────────────────────────────────────────────────────────────
▸ Type a message...                              /help · /model · /server

特性

  • 多服务器 --配置多个Ollama/llama.cpp后端,切换 /server
  • 流媒体 --逐令牌响应呈现,实时shell逐行输出
  • 工具调用 --带有权限提示的shell、read_file、write_file、edit_file、list_file
  • MCP支持 --具有自动检测功能的stdio、SSE和流式HTTP传输
  • 思维方式 --解析 `` 带有精美印刷、可折叠方块和独特视觉风格的标签
  • 权限 --shell允许/拒绝/始终保存/模式提示;每个会话自动允许文件系统工具; --yolo 跳过所有提示
  • 技能 --带有frontmatter的全局markdown文件(~/.config/llama-chat/skills/)每个项目(.llama-chat/skills/)
  • 项目背景 --加载CLAUDE.md、AGENTS.md、游标 .cursor/rules/*.mdc,以及 .llama-chat/context.md 根据系统提示
  • 主题 --带有每种颜色十六进制覆盖的暗/亮预设,包括特定思考的颜色
  • 记忆 --具有自动对话存档、混合FTS+矢量搜索和基于LLM的提取的长期记忆

记忆

llama聊天包括一个可选的长期记忆系统,该系统维护两个数据库:

  • 全球 (~/.local/share/llama-chat/global.db)--用户偏好、反馈、跨项目事实
  • 项目 (.llama-chat/memory.db)--项目特定背景、对话档案

配置

# config.toml
[memory]
enabled = true
embedding_model = "nomic-embed-text"  # model name for embeddings
embedding_server = "local"            # server from [servers] to use
top_n = 8                             # max memories injected per turn
decay_half_life_days = 90             # time decay for curated memories
extraction_on_clear = true            # run extraction on /clear

[servers.local]
url = "http://localhost:11434/v1"

嵌入服务器必须支持OpenAI兼容 /embeddings 终点。所有主要的本地LLM服务器(Ollama、llama.cpp、vLLM)都支持此功能。

Slash命令

命令操作
/remember 保存精心策划的记忆(用户偏好、项目事实等)
/forget 按ID删除内存
/memory [limit]列出最近的回忆

运作原理

  1. 自动归档:每个对话回合都被分块(500个令牌,50个令牌重叠),嵌入并存储在项目数据库中
  2. 混合检索:用户消息触发全文搜索(FTS5)和向量搜索(HNSW),并与互惠排名融合
  3. 注入:Top-N内存作为 `` 块
  4. 会话提取结束:打开 /clear/exit,法学硕士审查对话并提取关键事实,以保存为精心策划的记忆
  5. 孤儿康复:崩溃的会话将在下次启动时自动提取

记忆是有作用域的:全局记忆出现在所有项目中,项目记忆只出现在他们的项目中。

安装

cargo install --path .

需要Rust 1.85+(2024版)。

配置

Config住在 ~/.config/llama-chat/:

# config.toml
[servers.local]
name = "Local Ollama"
url = "http://localhost:11434/v1"

[servers.remote]
name = "GPU Box"
url = "http://gpu-box:8080/v1"
api_key = "sk-your-token-here"

[defaults]
server = "local"
model = "llama3:8b"
show_thinking = true  # show/hide thinking blocks (default: true)

[theme]
preset = "dark"  # or "light"

[theme.colors]  # optional overrides
accent = "#818cf8"
tool_ok = "#34d399"
thinking_header = "#fbbf24"  # thinking block header color
thinking_text = "#b4b4b4"     # thinking block text color
thinking_border = "#fbbf24"   # thinking block border color

MCP服务器

// ~/.config/llama-chat/mcp.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
    },
    "remote": {
      "url": "http://mcp-server:3001/sse"
    }
  }
}

自动检测传输: command 字段表示stdio, url 字段尝试流式HTTP,然后回退到SSE。集 "transport": "sse" 以覆盖。

用法

llama-chat          # normal mode
llama-chat --yolo   # skip all permission prompts

Slash命令

命令操作
/model [name]可用的开关型号或列表
/server [name]已配置交换机服务器或列表
/tools列出活动工具
/skills列出技能
/thinking切换思维显示
/init为项目生成AGENTS.md
/remember 保存内存(如果启用了内存)
/forget 按ID删除内存
/memory [limit]列出最近的回忆
/clear清除对话(如果启用,则运行提取)
/help显示命令
/exit退出(如果启用,则运行提取)

技能按名称调用: /review, /explain等等。

快捷键

关键行动
Enter发送消息
Ctrl+C停止生成(流式传输时)/退出(空闲时)
t切换思维显示
Esc退出
A允许工具调用
D拒绝工具调用
S始终保存(保存到permissions.json)
P保存球形图案

按项目配置

.llama-chat/
├── permissions.json   # saved allow rules
├── context.md         # project-specific system prompt
└── skills/            # project-specific skills

该应用程序还读取 CLAUDE.md, AGENTS.md,以及 .cursor/rules/*.mdc 从项目根开始,与其他AI工具兼容。

建筑

带有tokio的事件驱动异步应用程序。三个输入源为中央mpsc通道供电:

Terminal input (crossterm) ──┐
API stream (reqwest SSE)   ──┼──▸ Event Channel ──▸ App State Machine ──▸ ratatui render
MCP clients (stdio/http)   ──┘

许可证

麻省理工学院

目录标签

目录标签

LLM交互RustClaude本地部署终端工具Rust开发多服务器支持流式响应

支持客户端

ClaudeCursor

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP