Skip to content
View AMSN88's full-sized avatar

Block or report AMSN88

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
AMSN88/README.md

AMSN88

本地大模型方向:从推理性能实测,到 Agent 的工程化落地。

项目

在单张 8 GiB 笔记本显卡(RTX 4060 Laptop)上对 llama.cpp CUDA 版的完整实测:

  • KV Cache 源码剖析:连续大块 KV + cell 槽位复用 + 环形游标分配器,逐条给出文件与行号索引; 并说明 llama.cpp 没有 PagedAttention / block table(含全仓库检索证据);
  • 显存可行性定量证明-c 32768 -np 10 需要 16384 MiB 纯 KV(512 KiB/token), 在 8 GiB 卡上物理不可行,附真实 cudaMalloc failed: out of memory 日志;
  • 并发压测与基准:llama-server 10 并发压测矩阵(客户端 CSV + /metrics 快照)、 llama-bench 的 Q4_K_M 与 Q8_0 对比(吞吐、TTFT/TPOT,并标注换算口径与限制)。

原始编译日志、压测日志、结果 CSV 与复现脚本全部随仓库提供。

llama.cpp CUDA KV cache benchmark VRAM llama-server

本地工具调用 Agent 的基础设施,重点解决三件事:

  • 文件边界:按会话隔离的 workspace 沙箱 + 路径白名单(Path.resolve() + is_relative_to), 同一批 8 条越权路径从改造前允许 7/8 收敛到 1/8;
  • 多会话隔离与持久化:内存字典 + SQLite,thread_id = session_id,重启后按会话恢复;
  • 小模型工具调用可靠性:GBNF 约束解码把动作锁进枚举,真实 llama-server 联调合法率 96.67%, 语义安全由工具白名单与安全网关兜底。

配套 FastAPI 服务化、全链路 trace(JSONL + P95 统计)、 LangGraph 检查点中断恢复(两个独立进程实测),以及 5 张由真实数据生成的图表。

LLM agent LangGraph GBNF sandbox FastAPI observability

关注方向

  • 本地推理的性能与显存工程(量化、KV cache、并发)
  • Agent 的隔离、可观测性与可恢复性
  • 让量化小模型的工具调用在生产上可用

Popular repositories Loading

  1. llamacpp-cuda-kv-bench llamacpp-cuda-kv-bench Public

    llama.cpp CUDA on an 8 GiB laptop GPU: KV cache source study, 32k-context feasibility, llama-server concurrency stress test and llama-bench (Q4_K_M vs Q8_0), with raw logs and CSVs

    Python

  2. local-llm-agent local-llm-agent Public

    Local LLM tool-calling agent infrastructure: session-isolated workspace sandbox, path whitelist, FastAPI service, tracing, checkpoint resume and GBNF-constrained tool calls

    Python

  3. AMSN88 AMSN88 Public

    GitHub profile