湖北省网站建设_网站建设公司_UX设计_seo优化
2026/1/2 8:04:40 网站建设 项目流程

litAI llm router 框架

litai 是Lightning-AI 团队提供的一个llm router 框架,支持通过openai 格式进行llm api 访问,比较适合构建agent 以及ai app, 同时还支持tools 调用

参考玩法

  • tools 调用
from litai import LLM, tool@tool
def get_weather(location: str):return f"The weather in {location} is sunny"llm = LLM(model="openai/gpt-5")# OPTION A: automatic tool call
result = llm.chat("What's the weather in Tokyo?", tools=[get_weather], auto_call_tools=True)
# The weather in Tokyo is sunny# OPTION B: manually call tools for more control
chosen_tool = llm.chat("What's the weather in Tokyo?", tools=[get_weather])
result = llm.call_tool(chosen_tool, tools=[get_weather])
# The weather in London is sunny

参考资料

实际上类似的工具还是不少的,比如litellm, litai 目前star 并不是很多,但是值得尝试下,比较轻量

参考资料

https://github.com/Lightning-AI/litAI

https://github.com/BerriAI/litellm

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询