Package com.tnsai.llm.providers
Class LMStudioClient
java.lang.Object
com.tnsai.llm.providers.AbstractLLMClient
com.tnsai.llm.providers.AbstractOpenAICompatibleClient
com.tnsai.llm.providers.LMStudioClient
- All Implemented Interfaces:
com.tnsai.llm.LLMClient
LM Studio LLM client.
LM Studio is a desktop app that runs local LLMs and exposes an
OpenAI-compatible HTTP server (default http://localhost:1234/v1).
Same wire format as every other OpenAI-shape provider in this module —
the differences are operational:
- No API key required. LM Studio runs ungated locally;
the
Authorizationheader is only sent when anapiKeyis explicitly supplied (e.g. for an LM-Studio instance behind a reverse-proxy with basic auth). - Model name comes from the loaded model in the LM Studio
UI. Probe via
GET /v1/modelsto discover what's currently served, then pass that identifier asmodel.
Configuration via environment variables:
LMSTUDIO_BASE_URL— Optional override, defaults tohttp://localhost:1234/v1.LMSTUDIO_API_KEY— Optional bearer token for LM-Studio-behind-proxy setups; omitted by default.
This client follows the OllamaClient pattern: it accepts
the apiKey parameter for parity with the other providers but
does not call requireApiKey — passing null is fine
for the local-only default deployment.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLMStudioClient(String model) LMStudioClient(String model, float temperature) LMStudioClient(String model, float temperature, Float topP, Integer maxTokens) LMStudioClient(String model, float temperature, Integer maxTokens) LMStudioClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey) LMStudioClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey) -
Method Summary
Methods inherited from class com.tnsai.llm.providers.AbstractOpenAICompatibleClient
chat, streamChatMethods inherited from class com.tnsai.llm.providers.AbstractLLMClient
getBaseUrl, getCallTimeoutMs, getMaxTokens, getModel, getTemperature, getTopPMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tnsai.llm.LLMClient
chat, chat, chat, chat, chat, getCapabilities, getProviderName, listModels, streamChat, streamChat, streamChatWithHandler, streamChatWithHandler, streamChatWithSpec, streamChatWithSpec
-
Constructor Details
-
LMStudioClient
-
LMStudioClient
-
LMStudioClient
-
LMStudioClient
-
LMStudioClient
-
LMStudioClient
-