[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6J1CY9874WDPR28SSD6PWAG":3,"skill-same:01M6J1CY9874WDPR28SSD6PWAG":73},{"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":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6J1CY9874WDPR28SSD6PWAG","liter-llm-calling-llms",null,"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.","xberg-io\u002Fliter-llm","xberg-io","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F241328462?v=4","01M6BYYMACFMK5WNT338Y71K58","Xberg.io","01M6J160RA8VS7XVE01W9305F3",265,"MIT","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-calling-llms\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"liter llm","liter llm calling llms","calling","llms","chat","provider routing","when","hint","categories","error","via","roles","message","call","provider","shape","use","model","routing","2026-11-10 10:12:30",false,"---\ndescription: 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.\nname: liter-llm-calling-llms\n---\n\n\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:d45c8ad7f731f0e0bc91646e677fd7c89b6af31e38944bff4302e7e242a12906\nSource-Hash: blake3:725e6663621cbc5ffbaf9dbb2141fe5f9b95aee234fe9f7ece2d2b6e63dc5a66\nSchema-Version: v1\n-->\n\n# Calling LLMs\n\nBuild a `ChatCompletionRequest` and send it with `client.chat(request)`. Create\nthe client with `create_client(...)`. The model string is `provider\u002Fmodel`; the\nprefix selects the backend.\n\n```python\nimport asyncio, json, 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(json.dumps({\n        \"model\": \"openai\u002Fgpt-4o\",\n        \"messages\": [\n            {\"role\": \"system\", \"content\": \"You are concise.\"},\n            {\"role\": \"user\", \"content\": \"Name three Rust crates for HTTP.\"},\n        ],\n    }))\n    response = await client.chat(request)\n    print(response.choices[0].message.content)\n\nasyncio.run(main())\n```\n\n## Provider routing\n\nThe model string's prefix selects the provider; build a request per backend:\n\n```python\nChatCompletionRequest.from_json('{\"model\":\"anthropic\u002Fclaude-sonnet-4-20250514\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"gemini\u002Fgemini-2.0-flash\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"groq\u002Fllama3-70b\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"mistral\u002Fmistral-large-latest\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"bedrock\u002Fanthropic.claude-v2\",\"messages\":[...]}')\n```\n\nSet a full `provider\u002Fmodel` as `model_hint` at construction to select the client\nprovider and credential source. Requests without a recognized prefix fall back to\nthat client provider:\n\n```python\nclient = create_client(api_key=os.environ[\"OPENAI_API_KEY\"], model_hint=\"openai\u002Fgpt-4o\")\n# the request model can now omit the provider prefix:\nrequest = ChatCompletionRequest.from_json('{\"model\":\"gpt-4o\",\"messages\":[...]}')\nawait client.chat(request)  # routes to OpenAI\n```\n\n## Notes\n\n- Keys come from env vars (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, …); never\n  hardcode them.\n- Without a recognized prefix, requests fall back to the client's configured provider;\n  a client without `model_hint` defaults to OpenAI.\n- Environment credentials are selected when constructing the client, not independently\n  for every request. Use a separate client with matching `model_hint` and credentials\n  for each provider. A prefix changes routing but does not switch the client's API key.\n- Python errors are typed exceptions exported from `liter_llm`:\n  `AuthenticationError`, `RateLimitedError`, `BadRequestError`,\n  `ContextWindowExceededError`, `ContentPolicyError`, `NotFoundError`,\n  `ServerError`, `ServiceUnavailableError`, `LiterLlmTimeoutError`,\n  `BudgetExceededError` — all subclasses of `LiterLlmError`.\n","\u003C!--\nAI-RULEZ :: GENERATED FILE — DO NOT EDIT\nContent-Hash: blake3:d45c8ad7f731f0e0bc91646e677fd7c89b6af31e38944bff4302e7e242a12906\nSource-Hash: blake3:725e6663621cbc5ffbaf9dbb2141fe5f9b95aee234fe9f7ece2d2b6e63dc5a66\nSchema-Version: v1\n-->\n\n# Calling LLMs\n\nBuild a `ChatCompletionRequest` and send it with `client.chat(request)`. Create\nthe client with `create_client(...)`. The model string is `provider\u002Fmodel`; the\nprefix selects the backend.\n\n```python\nimport asyncio, json, 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(json.dumps({\n        \"model\": \"openai\u002Fgpt-4o\",\n        \"messages\": [\n            {\"role\": \"system\", \"content\": \"You are concise.\"},\n            {\"role\": \"user\", \"content\": \"Name three Rust crates for HTTP.\"},\n        ],\n    }))\n    response = await client.chat(request)\n    print(response.choices[0].message.content)\n\nasyncio.run(main())\n```\n\n## Provider routing\n\nThe model string's prefix selects the provider; build a request per backend:\n\n```python\nChatCompletionRequest.from_json('{\"model\":\"anthropic\u002Fclaude-sonnet-4-20250514\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"gemini\u002Fgemini-2.0-flash\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"groq\u002Fllama3-70b\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"mistral\u002Fmistral-large-latest\",\"messages\":[...]}')\nChatCompletionRequest.from_json('{\"model\":\"bedrock\u002Fanthropic.claude-v2\",\"messages\":[...]}')\n```\n\nSet a full `provider\u002Fmodel` as `model_hint` at construction to select the client\nprovider and credential source. Requests without a recognized prefix fall back to\nthat client provider:\n\n```python\nclient = create_client(api_key=os.environ[\"OPENAI_API_KEY\"], model_hint=\"openai\u002Fgpt-4o\")\n# the request model can now omit the provider prefix:\nrequest = ChatCompletionRequest.from_json('{\"model\":\"gpt-4o\",\"messages\":[...]}')\nawait client.chat(request)  # routes to OpenAI\n```\n\n## Notes\n\n- Keys come from env vars (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, …); never\n  hardcode them.\n- Without a recognized prefix, requests fall back to the client's configured provider;\n  a client without `model_hint` defaults to OpenAI.\n- Environment credentials are selected when constructing the client, not independently\n  for every request. Use a separate client with matching `model_hint` and credentials\n  for each provider. A prefix changes routing but does not switch the client's API key.\n- Python errors are typed exceptions exported from `liter_llm`:\n  `AuthenticationError`, `RateLimitedError`, `BadRequestError`,\n  `ContextWindowExceededError`, `ContentPolicyError`, `NotFoundError`,\n  `ServerError`, `ServiceUnavailableError`, `LiterLlmTimeoutError`,\n  `BudgetExceededError` — all subclasses of `LiterLlmError`.\n",{"name":5,"description":7},"main","2bc4403def694d18143810aa54dc8522a45705ca","skills\u002Fliter-llm-calling-llms",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-12 21:51:28",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add xberg-io\u002Fliter-llm --skill liter-llm-calling-llms",{"tool":59,"command":60},"bunx","bunx skills add xberg-io\u002Fliter-llm --skill liter-llm-calling-llms",{"tool":62,"command":63},"pnpm","pnpm dlx skills add xberg-io\u002Fliter-llm --skill liter-llm-calling-llms","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-calling-llms\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"index.md","REFERENCE","参考文档",499,"https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-calling-llms\u002Findex.md",[74,111,129,146,161,182],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":93,"publishedAt":38},"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",[80,85,88],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":86,"categoryName":87,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":89,"categoryName":90,"taxonomyType":91,"taxonomyTypeDesc":92},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[19,94,95,96,97,98,99,100,101,102,103,104,105,106,107,22,108,109,110,25],"ocr","web search","search","rust","middleware","ruby","MCP","writing","image","mcp server","code","api","io","streaming","server","native","elixir",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":119,"publishedAt":38},"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",[117,118],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},{"categoryNo":86,"categoryName":87,"taxonomyType":83,"taxonomyTypeDesc":84},[100,103,120,108,19,121,122,123,124,21,125,35,126,127,128,25],"liter llm using the mcp server","launcher","decide","authentication","tool","auto","cli","sdk","Tools",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":38},"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",[],[136,124,21,137,19,138,139,140,32,35,141,142,143,128,144,145,25],"tool calling","liter llm tool calling","llm tool","for","calls","functions","json","formats","structured","outputs",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":38},"01M6J1DBN4XD93NN04WA8ZP75H","liter-llm-streaming-responses","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.","https:\u002F\u002Fgithub.com\u002Fxberg-io\u002Fliter-llm\u002Fblob\u002Fmain\u002Fskills\u002Fliter-llm-streaming-responses\u002FSKILL.md",[],[153,19,107,23,154,29,155,156,35,157,158,159,160,25],"liter llm streaming responses","delta","tokens","async","content","sse","chunks","stream",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":38},"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",[],[168,169,19,170,171,172,173,36,174,35,105,175,37,176,177,178,179,180,181,25],"proxy","liter llm running the proxy","running","openai-compatible","virtual","gateway","toml","cost","REST","endpoints","keys","config","limits","llm api",{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":188,"publishedAt":38},"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",[],[96,189,19,190,94,191,21,35,192,193,194,195,196,197,198,170,25],"liter llm embeddings and search","embeddings","methods","documents","embed","with","web","web-search","Providers","reranking"]