[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6J178VPDWVGM2DXJGFM5MN6":3,"skill-same:01M6J178VPDWVGM2DXJGFM5MN6":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M6J178VPDWVGM2DXJGFM5MN6","liter-llm-streaming-responses",null,"Use when streaming tokens incrementally from an LLM via liter-llm over SSE or async iterators. Covers chat_stream, delta handling, and null-content chunks.","xberg-io\u002Fliter-llm","xberg-io","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F241328462?v=4","01M6BYYMACFMK5WNT338Y71K58","Xberg.io","01M6J160RA8VS7XVE01W9305F3",266,"MIT","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fplugin\u002F.ai-rulez\u002Fskills\u002Fliter-llm-streaming-responses\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"streaming","liter llm streaming responses","liter llm","content","playbook","sse","use","async","delta","chat","tokens","via","stream","chunks","when","2026-11-10 10:12:30",false,"---\ntype: Playbook\ntitle: Streaming Responses\ndescription: Use when streaming tokens incrementally from an LLM via liter-llm over SSE or async iterators. Covers chat_stream, delta handling, and null-content chunks.\nx-ai-rulez:\n  kind: skill\n  id: liter-llm-streaming-responses\n  metadata:\n    name: liter-llm-streaming-responses\n---\n\n# Streaming Responses\n\nUse `chat_stream(...)` to receive tokens as they are produced instead of waiting\nfor the full completion. The proxy streams over SSE; bindings expose async\niterators.\n\n## Python\n\n```python\nimport asyncio, os\nfrom liter_llm import create_client\nfrom liter_llm._internal_bindings import ChatCompletionRequest\n\nasync def main() -> None:\n    client = create_client(api_key=os.environ[\"OPENAI_API_KEY\"])\n    request = ChatCompletionRequest.from_json(\n        '{\"model\":\"openai\u002Fgpt-4o\",\"messages\":[{\"role\":\"user\",\"content\":\"Tell me a story\"}],\"stream\":true}'\n    )\n    async for chunk in client.chat_stream(request):\n        if chunk.choices and chunk.choices[0].delta.content:\n            print(chunk.choices[0].delta.content, end=\"\", flush=True)\n    print()\n\nasyncio.run(main())\n```\n\n## TypeScript\n\n```typescript\nimport { createClient } from \"@xberg-io\u002Fliter-llm\";\n\nconst client = createClient(process.env.OPENAI_API_KEY!);\nconst chunks = await client.chatStream({\n  model: \"openai\u002Fgpt-4o\",\n  messages: [{ role: \"user\", content: \"Tell me a story\" }],\n});\nfor await (const chunk of chunks) {\n  process.stdout.write(chunk.choices?.[0]?.delta?.content ?? \"\");\n}\n```\n\n## Notes\n\n- The first and last chunks often carry null content. Always null-check\n  `chunk.choices[0].delta.content` (Python) or\n  `chunk.choices[0]?.delta?.content` (TypeScript) before using it.\n- Tool-call deltas arrive in `delta.tool_calls` (Python) \u002F\n  `delta.toolCalls` (TypeScript); accumulate `function.arguments` fragments\n  across chunks before parsing.\n- Through the proxy, request streaming with `\"stream\": true` on\n  `\u002Fv1\u002Fchat\u002Fcompletions`.\n","# Streaming Responses\n\nUse `chat_stream(...)` to receive tokens as they are produced instead of waiting\nfor the full completion. The proxy streams over SSE; bindings expose async\niterators.\n\n## Python\n\n```python\nimport asyncio, os\nfrom liter_llm import create_client\nfrom liter_llm._internal_bindings import ChatCompletionRequest\n\nasync def main() -> None:\n    client = create_client(api_key=os.environ[\"OPENAI_API_KEY\"])\n    request = ChatCompletionRequest.from_json(\n        '{\"model\":\"openai\u002Fgpt-4o\",\"messages\":[{\"role\":\"user\",\"content\":\"Tell me a story\"}],\"stream\":true}'\n    )\n    async for chunk in client.chat_stream(request):\n        if chunk.choices and chunk.choices[0].delta.content:\n            print(chunk.choices[0].delta.content, end=\"\", flush=True)\n    print()\n\nasyncio.run(main())\n```\n\n## TypeScript\n\n```typescript\nimport { createClient } from \"@xberg-io\u002Fliter-llm\";\n\nconst client = createClient(process.env.OPENAI_API_KEY!);\nconst chunks = await client.chatStream({\n  model: \"openai\u002Fgpt-4o\",\n  messages: [{ role: \"user\", content: \"Tell me a story\" }],\n});\nfor await (const chunk of chunks) {\n  process.stdout.write(chunk.choices?.[0]?.delta?.content ?? \"\");\n}\n```\n\n## Notes\n\n- The first and last chunks often carry null content. Always null-check\n  `chunk.choices[0].delta.content` (Python) or\n  `chunk.choices[0]?.delta?.content` (TypeScript) before using it.\n- Tool-call deltas arrive in `delta.tool_calls` (Python) \u002F\n  `delta.toolCalls` (TypeScript); accumulate `function.arguments` fragments\n  across chunks before parsing.\n- Through the proxy, request streaming with `\"stream\": true` on\n  `\u002Fv1\u002Fchat\u002Fcompletions`.\n",{"type":39,"title":40,"x-ai-rulez":41,"description":7},"Playbook","Streaming Responses",{"id":5,"kind":42,"metadata":43},"skill",{"name":5},"main","81dd58501327dc68d81676f236766c08c0d31deb","plugin\u002F.ai-rulez\u002Fskills\u002Fliter-llm-streaming-responses",27,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm","https:\u002F\u002Fdocs.liter-llm.xberg.io","https:\u002F\u002Fgithub.com\u002Fxberg-io","https:\u002F\u002Fxberg.io","Open-source content intelligence with a Rust core: documents, web, LLMs and code, with native bindings for every major language.","2026-11-14 23:17:35",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add xberg-io\u002Fliter-llm --skill liter-llm-streaming-responses",{"tool":60,"command":61},"bunx","bunx skills add xberg-io\u002Fliter-llm --skill liter-llm-streaming-responses",{"tool":63,"command":64},"pnpm","pnpm dlx skills add xberg-io\u002Fliter-llm --skill liter-llm-streaming-responses","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fplugin\u002F.ai-rulez\u002Fskills\u002Fliter-llm-streaming-responses\u002FSKILL.md",true,[68],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"index.md","REFERENCE","参考文档",204,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fplugin\u002F.ai-rulez\u002Fskills\u002Fliter-llm-streaming-responses\u002Findex.md",[75,99,116,134,139,162],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":34},"01M6J1DRP0968S21HH1C4HR9RK","liter-llm","Universal LLM API client for 174 providers with native bindings for 14 languages. Use when writing code that calls LLM APIs via liter-llm in Python, TypeScript, Rust, Go, Java, C#, Ruby, PHP, Elixir, WASM, or C, when running the OpenAI-compatible proxy, or when calling LLMs through the MCP server. Covers chat, streaming, tool calling, embeddings, image generation, speech, transcription, moderation, web search, OCR, reranking, provider routing, middleware, and configuration.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm\u002FSKILL.md",[],[21,82,83,84,85,86,87,88,89,90,91,92,93,94,19,95,96,97,98,33],"ocr","web search","search","rust","middleware","ruby","MCP","writing","image","mcp server","code","api","io","llms","server","native","elixir",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":34},"01M6J1DK94H9KDPW62F1E96VRR","liter-llm-using-the-mcp-server","Use when calling LLM APIs through the liter-llm MCP server's 22 tools, and to decide when MCP beats the CLI or SDK. Covers the tool surface, the auto-installing launcher, and authentication.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-using-the-mcp-server\u002FSKILL.md",[],[88,91,106,96,21,107,108,109,110,111,112,25,113,114,115,33],"liter llm using the mcp server","launcher","decide","authentication","tool","calling","auto","cli","sdk","Tools",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":34},"01M6J1DEEPNVQ3E5CX5ZF69416","liter-llm-tool-calling","Use when defining functions\u002Ftools for an LLM to call through liter-llm, or requesting structured JSON outputs. Covers tool schemas, tool_calls handling, and response formats.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-tool-calling\u002FSKILL.md",[],[123,110,111,124,21,125,126,127,128,25,129,130,131,115,132,133,33],"tool calling","liter llm tool calling","llm tool","for","calls","call","functions","json","formats","structured","outputs",{"skillNo":135,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":34},"01M6J1DBN4XD93NN04WA8ZP75H","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-streaming-responses\u002FSKILL.md",[],[20,21,19,28,27,30,29,26,25,22,24,32,31,33],{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":34},"01M6J1D76FTYTKSPWNNRVZ2PX3","liter-llm-running-the-proxy","Use when running the `liter-llm api` OpenAI-compatible gateway — virtual keys, per-key rate limits, budgets, cost tracking, and model routing. Covers the TOML config and the 22 REST endpoints.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-running-the-proxy\u002FSKILL.md",[],[146,147,21,148,149,150,151,152,153,25,93,154,155,156,157,158,159,160,161,33],"proxy","liter llm running the proxy","running","openai-compatible","virtual","gateway","model","toml","cost","routing","REST","endpoints","keys","config","limits","llm api",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":34},"01M6J1D2W434JGGHXR8SP91PZ3","liter-llm-embeddings-and-search","Use when generating embeddings, calling the 12 web-search providers, or running OCR over documents with the 4 OCR providers through liter-llm. Covers embed, search, and ocr methods plus reranking.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-embeddings-and-search\u002FSKILL.md",[],[84,169,21,170,82,171,111,25,172,173,174,175,176,177,178,148,33],"liter llm embeddings and search","embeddings","methods","documents","embed","with","web","web-search","Providers","reranking"]