|
|
1 mēnesi atpakaļ | |
|---|---|---|
| .. | ||
| docs | 1 mēnesi atpakaļ | |
| tests | 1 mēnesi atpakaļ | |
| README.md | 1 mēnesi atpakaļ | |
| litellm_lmstudio_adapter.py | 1 mēnesi atpakaļ | |
This folder contains a standalone FastAPI adapter that lets LiteLLM or any other OpenAI-compatible caller use LM Studio native APIs while preserving LM Studio-specific reasoning controls.
GET /v1/modelsPOST /v1/chat/completionsPOST /v1/responsesPOST /v1/embeddingsPOST /v1/completions/api/v1/*/api/v0/*POST /v1/chat/completionsPOST /v1/responsesreasoning: "on" | "off"enable_thinking: true | false/v1/audio/*/v1/images/*/v1/moderations/v1/filesThese return OpenAI-shaped 501 not_implemented errors for now.
python services\litellm-lmstudio-adapter\litellm_lmstudio_adapter.py --host 127.0.0.1 --port 8010 --upstream http://127.0.0.1:7860
Use this adapter as an OpenAI-compatible backend behind LiteLLM.
Example LiteLLM config idea:
model_list:
- model_name: qwen36-local
litellm_params:
model: openai/qwen/qwen3.6-35b-a3b
api_base: http://127.0.0.1:8010
api_key: dummy
Then call LiteLLM normally with:
{
"model": "qwen36-local",
"messages": [
{"role": "user", "content": "Compute 317 * 29. Give the final answer only."}
],
"reasoning": "off"
}
python -m unittest discover -s services/litellm-lmstudio-adapter/tests -p "test_*.py"
POST /v1/chat/completions non-streaming:
reasoning: "off" => direct answer, reasoning_tokens = 0reasoning: "on" => reasoning content returnedPOST /v1/chat/completions streaming:
[DONE]POST /v1/responses streaming:
response.createdresponse.output_text.deltaresponse.completed