Package com.tnsai.llm.providers
Class VLLMClient
java.lang.Object
com.tnsai.llm.providers.AbstractLLMClient
com.tnsai.llm.providers.AbstractOpenAICompatibleClient
com.tnsai.llm.providers.VLLMClient
- All Implemented Interfaces:
com.tnsai.llm.LLMClient
vLLM LLM client.
vLLM is a high-throughput self-hosted inference server
(typically invoked as
python -m vllm.entrypoints.openai.api_server). It exposes
an OpenAI-compatible HTTP server at http://localhost:8000/v1
by default — same wire format as every other OpenAI-shape provider
in this module. The differences from cloud providers are operational:
- No API key required by default. vLLM runs ungated
when self-hosted; the
Authorizationheader is only sent when anapiKeyis explicitly supplied (e.g. when vLLM is started with--api-keyor fronted by an auth proxy). - Model name = whatever the user loaded with vLLM's
--modelflag. Probe viaGET /v1/modelsto discover the currently-served model identifier and pass it asmodel.
Configuration via environment variables:
VLLM_BASE_URL— Optional override, defaults tohttp://localhost:8000/v1.VLLM_API_KEY— Optional bearer token for vLLM instances started with--api-keyor behind an auth proxy; omitted by default.
This client follows the OllamaClient / LMStudioClient
pattern: it accepts the apiKey parameter for parity with the
other providers but does not call requireApiKey — passing
null is fine for the self-hosted-default deployment.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVLLMClient(String model) VLLMClient(String model, float temperature) VLLMClient(String model, float temperature, Float topP, Integer maxTokens) VLLMClient(String model, float temperature, Integer maxTokens) VLLMClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey) VLLMClient(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
-
VLLMClient
-
VLLMClient
-
VLLMClient
-
VLLMClient
-
VLLMClient
-
VLLMClient
-