LiteLLM是一个开源Python库,通过提取原LiteLLM的核心功能、去除代理服务器和缓存层等复杂组件而创建1。该项目仅包含约2,900行代码和两个依赖项(openai和httpx),在保持轻量化的同时提供完整的LLM调用能力1。
该库支持19个LLM提供商,用户可通过"provider/model-name"的语法调用不同模型1。LiteLLM提供的功能包括模型路由、消息翻译、流式处理、工具调用和嵌入生成,同时与原LiteLLM的API保持一致,并支持异步操作变体1。在测试方面,该项目已通过262个自有测试、45个实时提供商测试和10个DSPy集成测试1。项目目前处于Alpha版本阶段1。
A lightweight open-source Python library called Litelm has been released, distilling the core functionality of the original LiteLLM project into a streamlined package 1. The library comprises approximately 2,900 lines of code and requires only two dependencies—openai and httpx—making it a minimal alternative for developers seeking LLM routing and message format conversion capabilities 1.
Litelm supports 19 LLM providers through a straightforward "provider/model-name" syntax and includes essential features such as model routing, message translation, streaming, tool calling, and embedding generation 1. The project maintains API compatibility with the original LiteLLM implementation and offers asynchronous variants of its core functions 1. The codebase has passed 262 internal tests, 45 live provider tests, and 10 DSPy integration tests 1. The project is currently in Alpha status 1.
评论
还没有评论,欢迎留下第一条。