技能 人工智能 本地模型聊天模板格式化

本地模型聊天模板格式化

v20261020
chat-format
将聊天消息格式化为本地模型模板(llama3、mistral、chatml、phi、gemma 或指定模型 ID),并通过小型 WASM HNSW 模式索引路由查询。适用于为 llama.cpp、Ollama 等本地运行时准备提示词。
获取技能
420 次下载
概览

Chat Format

Format prompts for multi-provider LLM inference with context retrieval.

When to use

When you need a prompt string in a local model's chat template (for llama.cpp, Ollama or another local runtime), or a small embedding-based router over a handful of patterns. It does not call a model and it does not format for hosted APIs: Anthropic, OpenAI and Gemini take structured messages, not a template string.

Steps

  1. Format chat — call mcp__plugin_ruflo-core_ruflo__ruvllm_chat_format with messages ([{role, content}]) and template: one of llama3, mistral, chatml, phi, gemma, or a model id to auto-detect. Both fields are required. It returns the formatted string. It needs @ruvector/ruvllm-wasm (npm i -g @ruvector/ruvllm-wasm); without it the call fails with an install hint.
  2. Create a router (optional) — ruvllm_hnsw_create with dimensions (for example 384), maxPatterns, efSearch. The WASM router holds about 11 patterns at most (ruvllm-wasm v2.0.1), so use it for routing between a few named intents, not for document retrieval. For real document search use memory_search or the ruflo-rag-memory plugin.
  3. Add patterns — ruvllm_hnsw_add with routerId, a name, and an embedding whose length equals the router's dimensions (you produce the embedding, for example with embeddings_generate).
  4. Route a query — ruvllm_hnsw_route with routerId, the query embedding, and k (default 3).
  5. Check status — ruvllm_status shows whether the WASM module loaded. Routers live in the MCP server process only; they are gone when it restarts.
信息
分类 人工智能
名称 chat-format
版本 v20261020
大小 2.18KB
更新时间 2026-10-21
语言