Metadata-Version: 2.4
Name: tapm-instrumentation-vllm
Version: 0.1b3
Summary: OpenTelemetry vLLM instrumentation
Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation-genai/opentelemetry-instrumentation-vllm
Project-URL: Repository, https://github.com/open-telemetry/opentelemetry-python-contrib
Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Requires-Dist: bytecode>=0.16.2
Requires-Dist: opentelemetry-api~=1.30
Requires-Dist: opentelemetry-semantic-conventions~=0.51b0
Requires-Dist: packaging>=25.0
Requires-Dist: tapm-instrumentation>=0.51b0
Requires-Dist: wrapt>=1.11.0
Provides-Extra: instruments
Requires-Dist: vllm>=0.7.0; extra == 'instruments'
Description-Content-Type: text/x-rst

OpenTelemetry vLLM Instrumentation
==================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-vllm.svg
   :target: https://pypi.org/project/opentelemetry-instrumentation-vllm/

This library allows tracing and metrics collection for vLLM LLM serving
framework.

Installation
------------

::

    pip install opentelemetry-instrumentation-vllm

Features
--------

- Works with vLLM 0.7.x–0.10.x (set ``VLLM_USE_V1=1`` to opt into the v1 engine
  when running 0.8.x–0.10.x).
- Captures spans for non-streaming and streaming ``create_completion`` and
  ``create_chat_completion`` calls, including prompt/response bodies, token usage
  and finish reasons.
- Hooks the internal LLM engine to emit spans with TTFT, queueing time, per-stage
  latency and sampling parameters.
- Hijacks vLLM's Prometheus loggers so that all engine metrics are pushed
  through OpenTelemetry meters instead of relying on pull-based scraping.

Usage
-----

.. code-block:: python

    from opentelemetry.instrumentation.vllm import VLLMInstrumentor

    VLLMInstrumentor().instrument()

References
----------

* `OpenTelemetry vLLM Instrumentation <https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/vllm/vllm.html>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_
* `vLLM <https://github.com/vllm-project/vllm>`_
