[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6J1DBN4XD93NN04WA8ZP75H":3,"skill-same:01M6J1DBN4XD93NN04WA8ZP75H":68},{"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":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6J1DBN4XD93NN04WA8ZP75H","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\u002Fskills\u002Fliter-llm-streaming-responses\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32],"streaming","liter llm streaming responses","liter llm","content","sse","use","async","delta","chat","tokens","via","stream","chunks","when","2026-11-10 10:12:30",false,"---\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.\nname: liter-llm-streaming-responses\n---\n\n\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:6de558b3f33f35e9e7ef76dc64d4ebd199a8a831dc28e306698f18fc16933b4e\nSource-Hash: blake3:725e6663621cbc5ffbaf9dbb2141fe5f9b95aee234fe9f7ece2d2b6e63dc5a66\nSchema-Version: v1\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","\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:6de558b3f33f35e9e7ef76dc64d4ebd199a8a831dc28e306698f18fc16933b4e\nSource-Hash: blake3:725e6663621cbc5ffbaf9dbb2141fe5f9b95aee234fe9f7ece2d2b6e63dc5a66\nSchema-Version: v1\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",{"name":5,"description":7},"main","2bc4403def694d18143810aa54dc8522a45705ca","skills\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-13 21:14:04",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add xberg-io\u002Fliter-llm --skill liter-llm-streaming-responses",{"tool":54,"command":55},"bunx","bunx skills add xberg-io\u002Fliter-llm --skill liter-llm-streaming-responses",{"tool":57,"command":58},"pnpm","pnpm dlx skills add xberg-io\u002Fliter-llm --skill liter-llm-streaming-responses","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-streaming-responses\u002FSKILL.md",true,[62],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"index.md","REFERENCE","参考文档",447,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-streaming-responses\u002Findex.md",[69,106,125,143,166,183],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":88,"publishedAt":33},"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",[75,80,83],{"categoryNo":76,"categoryName":77,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":81,"categoryName":82,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":84,"categoryName":85,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[21,89,90,91,92,93,94,95,96,97,98,99,100,101,19,102,103,104,105,32],"ocr","web search","search","rust","middleware","ruby","MCP","writing","image","mcp server","code","api","io","llms","server","native","elixir",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":114,"publishedAt":33},"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",[112,113],{"categoryNo":76,"categoryName":77,"taxonomyType":78,"taxonomyTypeDesc":79},{"categoryNo":81,"categoryName":82,"taxonomyType":78,"taxonomyTypeDesc":79},[95,98,115,103,21,116,117,118,119,120,121,24,122,123,124,32],"liter llm using the mcp server","launcher","decide","authentication","tool","calling","auto","cli","sdk","Tools",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":33},"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",[],[132,119,120,133,21,134,135,136,137,24,138,139,140,124,141,142,32],"tool calling","liter llm tool calling","llm tool","for","calls","call","functions","json","formats","structured","outputs",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":33},"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",[],[150,151,21,152,153,154,155,156,157,24,100,158,159,160,161,162,163,164,165,32],"proxy","liter llm running the proxy","running","openai-compatible","virtual","gateway","model","toml","cost","routing","REST","endpoints","keys","config","limits","llm api",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":33},"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",[],[91,173,21,174,89,175,120,24,176,177,178,179,180,181,182,152,32],"liter llm embeddings and search","embeddings","methods","documents","embed","with","web","web-search","Providers","reranking",{"skillNo":184,"name":185,"nameZh":6,"description":186,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":189,"publishedAt":33},"01M6J1CY9874WDPR28SSD6PWAG","liter-llm-calling-llms","Use when sending chat completions through liter-llm and routing to a specific provider via the `provider\u002Fmodel` prefix. Covers the chat call shape, provider routing, model_hint, message roles, and error categories.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-calling-llms\u002FSKILL.md",[],[120,190,102,21,191,192,156,193,137,24,27,194,159,195,29,196,197,32,198],"liter llm calling llms","categories","error","provider","roles","message","shape","hint","provider routing"]