本地对话(酒馆)
用 LiteRT-LM 在浏览器里跑 .litertlm 大模型聊天:支持多轮对话、可调参数(采样方式、温度、Top-K/Top-P、输出上限、随机种子、上下文预算、历史保留条数)、可覆盖系统提示词,并提供酒馆功能——角色卡(SillyTavern v2 字段:描述/性格/场景/开场白/示例对话/后置指令,可导入导出)、世界书(关键词触发 + 常驻条目)、用户人设、会话存档与导入导出;模型可本地选择文件或按链接下载,聊天内容不出设备。
它属于「AI 本地推理」分类:用 WASM 在浏览器本地跑模型:语音合成、本地对话(含酒馆玩法)可完全离线,音视频与聊天内容不上传服务器;语音转文字的离线引擎默认用 Whisper(int8 权重约 43/76 MB),可选的 LiteRT-LM 档位受上游运行时限制,详见工具页说明。
- 模型:任何 LiteRT-LM 格式的 `.litertlm` 都能用(官方在 litert-community 上发布了 Gemma3 / Qwen 等转换版)。点击「选择模型文件」从本机装载,或把文件拖进页面;也可以粘贴 HuggingFace 的 resolve 直链,站内会自动在官方源与 hf-mirror 之间换源。
- 装载后模型会一直留在内存里,切换角色/会话都不需要重新装载;只有改「上下文 token」才需要重新装载(它属于引擎级参数)。
- 多轮对话在一条会话里增量推进,历史不会被反复重新计算;点「重新生成」会用生成前的快照回退,不必重建整段对话。
- 角色卡按 SillyTavern v2 字段组织(描述 / 性格 / 场景 / 开场白 / 示例对话 / 后置指令),可以导入导出的 JSON 卡直接给别的酒馆客户端用。
- 世界书按关键词激活:最近几条消息里出现条目的关键词才会注入,标了「常驻」的条目永远注入;注入内容随该回合的用户消息一起发送,不写进历史,所以不会越滚越长。
- 「查看最终提示词」会把系统提示、角色设定、世界书、示例对话、后置指令按真实顺序拼出来给你看 —— 人物表现不对时先看这里,比反复调温度有效。
- 默认不启用任何云端服务:出字慢是端侧推理的正常表现(取决于模型大小与是否走 WebGPU),把「计算设备」切成 GPU 通常能快数倍。
- 所有角色卡、世界书与会话都存在你浏览器的 localStorage 里,导出按钮可以备份成 JSON;换浏览器或清缓存会丢,重要设定记得导出。
完全免费、无需注册;所有处理都在浏览器本地完成,文件不会上传到任何服务器。
相关关键词:本地对话(酒馆)、AI 本地推理、本地对话、chatbox、酒馆、角色扮演、litertlm、litert-lm、大模型、llm、系统提示词、世界书、角色卡、sillytavern、离线、ai chat、local llm、在线工具、免费
- 打开工具:打开「本地对话(酒馆)」页面,无需注册、无需安装任何软件。
- 准备输入:准备好两样东西:一个 `.litertlm` 对话模型(本地文件,或 HuggingFace 上的直链),以及想聊的内容。
- 填入内容:把内容粘贴进输入框,或把文件拖入页面;也可以点击「示例」先填入样例数据试一下。
- 设置选项并处理:按需调整页面上的选项,然后点击处理 / 转换 / 生成按钮。
- 获取结果:处理完全在浏览器本地完成,结果可直接复制或下载,文件不会上传到任何服务器。
- 这个对话是本地跑的吗?会不会把聊天内容发出去?
- 推理完全在浏览器里完成,聊天内容不会离开设备。唯一的联网动作是「从链接下载模型」这一步(如果你选择这种方式),下载的是模型权重本身。
- 为什么装好模型后第一句回复特别慢?
- 第一句要先 prefill 系统提示词(角色设定、世界书、示例对话都在里面),之后同一条会话里只处理新增消息,会明显变快。把「计算设备」切成 GPU 也能改善首句延迟。
- 角色卡和世界书怎么导入?
- 角色卡支持 SillyTavern v2({spec:"chara_card_v2", data:{…}})、v1 扁平卡、以及卡数组;世界书支持 {entries:[…]} 或条目数组。点对应的「导入」按钮选 JSON 文件即可。
- 上下文 token 是什么意思,该填多少?
- 它是引擎能同时容纳的 token 总量(系统提示 + 历史 + 输出)。填太小会记不住前文,填太大会吃内存。4B 以下的模型建议 4096;显存/内存紧张时降到 2048。改这个值需要重新装载模型。
- 能让模型只按我给的设定说话、不乱编身份吗?
- 用「后置指令」写一句强约束(例如「任何情况下都不要自称 AI」),它会被拼在系统提示的最后 —— 位置越靠后对模型的约束越强。再配合示例对话给一段正确的说话风格,效果比只调温度稳定得多。
Local Chat (Tavern)
Run a .litertlm LLM in your browser with LiteRT-LM: multi-turn chat, tunable parameters (sampler, temperature, Top-K/Top-P, max output, seed, context budget, retained history) and an overridable system prompt — plus tavern features: character cards (SillyTavern v2 fields — description, personality, scenario, first message, example dialogue, post-history instructions, import/export), world info with keyword activation and constant entries, a user persona, and session save/import/export. Load the model from a local file or a link; your chats never leave the device.
Belongs to “Local AI”: Run models locally in your browser with WASM: speech synthesis and local chat (with tavern features) work fully offline and never upload audio or conversations; the offline speech-to-text engine uses Whisper by default (int8 weights, ~43/76 MB), while the optional LiteRT-LM path is limited by the upstream runtime — see the tool page for details.
- Model: any LiteRT-LM `.litertlm` works (litert-community publishes converted Gemma3 / Qwen builds). Click "Choose model file" to load one from disk or drop it onto the page, or paste a HuggingFace resolve link — the page switches between the official host and hf-mirror automatically.
- Once loaded the model stays in memory; switching characters or sessions does not reload it. Only changing "context tokens" requires a reload (it is an engine-level setting).
- Multi-turn chat advances incrementally inside one conversation; history is not re-processed each turn. "Regenerate" rewinds to a snapshot taken before generation instead of rebuilding the whole conversation.
- Character cards use SillyTavern v2 fields (description / personality / scenario / first message / example dialogue / post-history instructions); exported JSON cards work in other tavern clients.
- World info activates by keyword: an entry is injected only when its keys appear in recent messages, while entries marked "constant" are always injected. Injected text travels with that turn's user message and is not written into history, so it does not grow over time.
- "Preview final prompt" shows the system prompt, character profile, world info, examples and post-history instructions in the real order — check that first when a character misbehaves, it beats tweaking temperature.
- No cloud service is used: slow output is normal for on-device inference (depends on model size and whether WebGPU is used). Switching "compute device" to GPU is usually several times faster.
- Characters, world books and sessions live in your browser localStorage; the export buttons produce JSON backups. Switching browsers or clearing storage loses them, so export what matters.
Free, no sign-up; everything runs locally in your browser and files are never uploaded.
Keywords: Local Chat (Tavern), Local AI, local chat, chatbox, tavern, roleplay, litertlm, litert-lm, llm, large language model, system prompt, world info, character card, sillytavern, offline, ai chat, local llm, online tool, free
- Open the tool:Open the “Local Chat (Tavern)” page — no sign-up and nothing to install.
- Prepare the input:Prepare two things: a `.litertlm` chat model (a local file or a direct HuggingFace link) and something to talk about.
- Provide the input:Paste your content into the input box or drop a file onto the page; you can also click “Sample” to try example data first.
- Adjust options and run:Adjust the options if needed, then click the process / convert / generate button.
- Get the result:Everything runs locally in your browser; copy or download the result — your files are never uploaded.
- Does this chat run locally? Is my conversation uploaded?
- Inference happens entirely in your browser and your messages never leave the device. The only network request is downloading the model weights, if you choose to load from a URL.
- Why is the first reply so slow after loading a model?
- The first turn has to prefill the system prompt (character profile, world info, examples). Later turns only process new messages and are much faster. Switching "compute device" to GPU also helps first-token latency.
- How do I import character cards and world info?
- Characters accept SillyTavern v2 cards ({spec:"chara_card_v2", data:{…}}), flat v1 cards and arrays of cards; world info accepts {entries:[…]} or an array of entries. Use the matching "Import" button to pick a JSON file.
- What are "context tokens" and what value should I use?
- It is the total token budget the engine can hold (system prompt + history + output). Too small and it forgets; too large and it eats memory. 4096 is a reasonable start for models under 4B; drop to 2048 when memory is tight. Changing it requires reloading the model.
- How do I keep the model in character?
- Put a hard constraint in "post-history instructions" (e.g. "never say you are an AI"); it is appended last in the system prompt, where it has the strongest effect. Pair it with example dialogue that shows the right voice — far more reliable than tweaking temperature.