VLLM & Unsloth Wrapper for simple local inference.
Project description
SimpleVLLM - A very simple unsloth + vllm wrapper to allow for easy generation locally.
"Does what is says on the tin." - good friend.
Getting Started:
- Installation:
pip3 install simple_vllm
Note: this will take time, as you are install vllm and unsloth.
- Running:
from simple_vllm import get_vllm_generator
# Create the client.
llm = get_vllm_generator(model_name="Qwen/Qwen2.5-3B-Instruct")
# Get the response as list of str
responses = llm("Hello, could you tell me how to become a better human")
print(responses[0])
More Advanced examples and parameters:
from simple_vllm import get_vllm_generator
# Create the client.
llm = get_vllm_generator(
model_name="Qwen/Qwen2.5-3B-Instruct",
max_seq_length = 4096,
gpu_memory_utilization=0.5,
load_in_4bit = True,
)
# Create a messages object in OpenAI format.
messages = [
{
"role" : "user",
"content" : "Hello, could you tell me how to become a better human?",
},
]
# Get the response as list of str
responses = llm(
messages,
num_generations=1,
max_completion_tokens=100,
temperature=0.0,
# other params are also possible have a look inside: simple_vllm/llm.py
)
# print response.
print(responses[0])
# generate again just using a string input this time, without having to reload the model.
responses = llm("tell me something about life.", max_completion_tokens=10)
print(responses[0])
(C) - Nikolai Rozanov, 2025 - Present
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simple_vllm-0.0.4.tar.gz
(41.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_vllm-0.0.4.tar.gz.
File metadata
- Download URL: simple_vllm-0.0.4.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4d08446befee769d3ca208ce5949dc1282328565da40994164c68b05c5b4554
|
|
| MD5 |
6ef238b26335f8d6f57c6366bae85a87
|
|
| BLAKE2b-256 |
8f9e67085998fceba0738846117a0ae1764f5ae1ac6856f0e0455d247384e8b3
|
File details
Details for the file simple_vllm-0.0.4-py3-none-any.whl.
File metadata
- Download URL: simple_vllm-0.0.4-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51b259062522df699a61e06c7fe0ae69ddc15de8a28bc1b1ba4179056af6e772
|
|
| MD5 |
3db131638db88c1c223ef50e576b3e15
|
|
| BLAKE2b-256 |
c75ccdfd80f68416e4e8adbf3e03809fd4b02aa0012e28d527a6a2f7b669e934
|