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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepeval_vllm-0.1.2.tar.gz (98.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepeval_vllm-0.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

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

Hashes for deepeval_vllm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f1cedddec5666ddb03ccc95b40b9544336513862ab2e309275fa2e10cf71b8c4
MD5 bd5f5e8f22d2629063ea43f537de31b6
BLAKE2b-256 9b3dd057e7d145bf2d277364cda6326c96861639bd7a98035384c0b6c1fd74c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepeval_vllm-0.1.2.tar.gz:

Publisher: python-publish.yml on profanta3/deepeval_vllm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for deepeval_vllm-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cd2b289d558fa08716299a9c21109ec4ec1ea97532ca1bfe0648a3ac228368e6
MD5 09e2a02c6d38ab461b64efc1a85332b1
BLAKE2b-256 c8ebdced9bdb2798140493268bafefff015b645bfdd7625b197f205cc49e5c38

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

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