litellm 支持responses api请求转换至后端 /chat/completions
donnad
·
2026-05-02
·
via LINUX DO - 最新话题
之前试过CLIProxyAPI 接入某云平台glm5给codex用。今天没事看了看litellm,发现v1.83.14支持了,就测试了下。除了remote compact有问题,其他的使用还算正常。 # litellm_config.yaml model_list: - model_name: GLM-5.1 litellm_params: model: openai/chat_completions/GLM-5.1 api_base: http://172.17.0.1:17800/v1 api_key: "xxx" docker run -d -v $(pwd)/litellm_config.yaml:/app/config.yaml -p 4000:4000 ghcr.io/berriai/litellm:v1.83.14-stable --config /app/config.yaml curl http://localhost:4000/v1/responses -H "Content-Type: application/json" -H "Authorization: Bearer sk-1234" -d '{ "model": "GLM-5.1", "input": "Hello!" }' {"id":"resp_bGl0ZWxsbTpjdXN0b21fbGxtX3Byb3ZpZGVyOm9wZW5haTttb2RlbF9pZDo5YjU3ODVjZWQ1ZjAyMDQ4YWVkOGUwNjQwYTUyZmYzMGRhODgyMDM4Y2U4Y2RiYjc3Y2QxNGM1ZTQzMzQwODY5O3Jlc3BvbnNlX2lkOmNoYXRjbXBsLWY3NTY0MDBmLTdkOWUtOTFkYS04MTEzLTE5ODBhMDQ0NWFiYQ==","created_at":1777695435,"error":null,"incomplete_details":null,"instructions":null,"metadata":{},"model":"GLM-5.1","object":"response","output":[{"type":"reasoning","id":"rs_-499540863581864856","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Let me consider how to respond to this greeting thoughtfully.\n\nThe user has started with a simple \"Hello!\" - this is a basic greeting that calls for a warm, professional response. I should acknowledge their greeting and create an inviting atmosphere for further conversation.\n\nI need to think about what makes an effective greeting response:\n- It should be welcoming and friendly\n- It should establish my role and capabilities\n- It should encourage further interaction\n- It should be concise but informative\n\nLooking at my purpose, I'm designed to be a helpful AI assistant that can engage in meaningful conversations and assist with various tasks. My response should reflect this while remaining approachable.\n\nThe key elements to include:\n1. A friendly return greeting\n2. A brief introduction of myself\n3. An open invitation for them to share what they need help with\n\nThis sets up a good foundation for whatever topic they might want to discuss next, whether it's questions, creative tasks, problem-solving, or general conversation.\n\nI'll craft a response that's warm and professional, making it easy for them to take the next step in our dialogue.","annotations":[]}],"phase":null},{"type":"message","id":"chatcmpl-f756400f-7d9e-91da-8113-1980a0445aba","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hello! I'm GLM, trained by Z.ai. How can I assist you today? Whether you have questions, need information, or just want to chat, I'm here to help.","annotations":[]}],"phase":null}],"parallel_tool_calls":false,"temperature":0.0,"tool_choice":"auto","tools":[],"top_p":null,"max_output_tokens":null,"previous_response_id":null,"reasoning":null,"status":"completed","text":{},"truncation":null,"usage":{"input_tokens":7,"input_tokens_details":{"audio_tokens":null,"cached_tokens":0,"text_tokens":null},"output_tokens":264,"output_tokens_details":{"reasoning_tokens":223,"text_tokens":null},"total_tokens":271,"cost":null},"user":null,"store":null} 仓库链接 Release v1.83.14-stable · BerriAI/litellm 1 个帖子 - 1 位参与者 阅读完整话题
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。