deepeval-vllm
Compatibility wrapper for DeepEval's LocalModel that adds native structured output support for vLLM servers.
Why
DeepEval's built-in LocalModel talks to any OpenAI-compatible endpoint, but when a metric needs a structured result it just asks the model for JSON in the prompt and then tries to salvage a JSON object out of whatever came back (trim_and_load_json). With smaller local models that fails often enough to poison an eval run -- malformed JSON, missing fields, prose wrapped around the payload.
vLLM can enforce the schema server-side with constrained decoding. VLLMLocalModel passes the Pydantic schema through as vLLM's structured_outputs request field, so the response is guaranteed to match the schema instead of merely being asked to.
Everything else -- client construction, retries, multimodal input, config resolution from env vars -- is inherited from LocalModel unchanged.
Installation
uv add deepeval-vllm
Requires Python 3.12+.
Usage
Point it at your vLLM server and hand it to any DeepEval metric:
from deepeval_vllm import VLLMLocalModel
model = VLLMLocalModel(
model="Qwen/Qwen3-8B",
base_url="http://localhost:8000/v1",
# ...
)
The constructor signature is LocalModel's, so the usual env vars work too:
export LOCAL_MODEL_NAME="Qwen/Qwen3-8B"
export LOCAL_MODEL_BASE_URL="http://localhost:8000/v1"
export LOCAL_MODEL_API_KEY="not-needed"
model = VLLMLocalModel()
Requirements
- A running vLLM server with an OpenAI-compatible API, recent enough to accept the
structured_outputsrequest field (>=v0.12.0). Older builds useguided_jsoninstead and will reject or ignore these requests. deepeval >= 4.1.8
Development
uv sync
The package lives in deepeval_vllm/; vllm_wrapper.py overrides generate and a_generate and nothing else.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 deepeval_vllm-0.1.2.tar.gz.
File metadata
- Download URL: deepeval_vllm-0.1.2.tar.gz
- Upload date:
- Size: 98.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1cedddec5666ddb03ccc95b40b9544336513862ab2e309275fa2e10cf71b8c4
|
|
| MD5 |
bd5f5e8f22d2629063ea43f537de31b6
|
|
| BLAKE2b-256 |
9b3dd057e7d145bf2d277364cda6326c96861639bd7a98035384c0b6c1fd74c6
|
Provenance
The following attestation bundles were made for deepeval_vllm-0.1.2.tar.gz:
Publisher:
python-publish.yml on profanta3/deepeval_vllm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deepeval_vllm-0.1.2.tar.gz -
Subject digest:
f1cedddec5666ddb03ccc95b40b9544336513862ab2e309275fa2e10cf71b8c4 - Sigstore transparency entry: 2581939108
- Sigstore integration time:
-
Permalink:
profanta3/deepeval_vllm@9df0250da0a5b1a171d03cd922c5d29bd827ee9c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/profanta3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9df0250da0a5b1a171d03cd922c5d29bd827ee9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file deepeval_vllm-0.1.2-py3-none-any.whl.
File metadata
- Download URL: deepeval_vllm-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd2b289d558fa08716299a9c21109ec4ec1ea97532ca1bfe0648a3ac228368e6
|
|
| MD5 |
09e2a02c6d38ab461b64efc1a85332b1
|
|
| BLAKE2b-256 |
c8ebdced9bdb2798140493268bafefff015b645bfdd7625b197f205cc49e5c38
|
Provenance
The following attestation bundles were made for deepeval_vllm-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on profanta3/deepeval_vllm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deepeval_vllm-0.1.2-py3-none-any.whl -
Subject digest:
cd2b289d558fa08716299a9c21109ec4ec1ea97532ca1bfe0648a3ac228368e6 - Sigstore transparency entry: 2581939111
- Sigstore integration time:
-
Permalink:
profanta3/deepeval_vllm@9df0250da0a5b1a171d03cd922c5d29bd827ee9c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/profanta3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9df0250da0a5b1a171d03cd922c5d29bd827ee9c -
Trigger Event:
push
-
Statement type: