Skip to main content

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_outputs request field (>=v0.12.0). Older builds use guided_json instead 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.

Metadata

Release files for deepeval-vllm 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepeval-vllm 0.1.2
File Size Uploaded Provenance Actions
deepeval_vllm-0.1.2.tar.gz 98.5 kB With provenance Details for deepeval_vllm-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deepeval-vllm 0.1.2
File Interpreter ABI Platform Actions
deepeval_vllm-0.1.2-py3-none-any.whl Python 3 none any Details for deepeval_vllm-0.1.2-py3-none-any.whl

Total release size: 105.6 kB

Release files / deepeval_vllm-0.1.2.tar.gz

Download URL deepeval_vllm-0.1.2.tar.gz
Size 98.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f1cedddec5666ddb03ccc95b40b9544336513862ab2e309275fa2e10cf71b8c4
BLAKE2b-256 checksum
How to use checksums
9b3dd057e7d145bf2d277364cda6326c96861639bd7a98035384c0b6c1fd74c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / deepeval_vllm-0.1.2-py3-none-any.whl

Download URL deepeval_vllm-0.1.2-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd2b289d558fa08716299a9c21109ec4ec1ea97532ca1bfe0648a3ac228368e6
BLAKE2b-256 checksum
How to use checksums
c8ebdced9bdb2798140493268bafefff015b645bfdd7625b197f205cc49e5c38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Security for deepeval-vllm 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for deepeval_vllm-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page