OpenTelemetry instrumentation for the Voyage AI Python client
pip install traceAI-voyage==0.1.1 Copy PIP instructions
Trace embeddings and reranking from the official Voyage AI Python client in Future AGI. The same instrumentor supports voyageai.Client and voyageai.AsyncClient.
pip install traceAI-voyage Requires Python 3.10–3.13, voyageai>=0.3.7, =1.1.0.
Set FI_API_KEY, FI_SECRET_KEY and VOYAGE_API_KEY in your environment, then register a trace provider and instrument the client:
import voyageai from fi_instrumentation import register from fi_instrumentation.fi_types import ProjectType from traceai_voyage import VoyageInstrumentor trace_provider = register(project_type=ProjectType.OBSERVE, project_name="my-rag-app") VoyageInstrumentor().instrument(tracer_provider=trace_provider) client = voyageai.Client() # reads VOYAGE_API_KEY client.embed(["What is the capital of France?"], model="voyage-3.5", input_type="query") client.rerank("capital of France", ["Paris is...", "Berlin is..."], model="rerank-2.5", top_k=1) client.contextualized_embed( [["Paris is the capital of France.", "The Seine flows through Paris."]], model="voyage-context-3", input_type="document", ) trace_provider.force_flush() Use client.multimodal_embed(inputs, model="voyage-multimodal-3") for mixed text and image inputs. Pass inputs in the format accepted by your Voyage SDK; the instrumentor does not transform them or invoke chunking callbacks.
Methods are wrapped on the client classes, so a client created before instrument() is traced too. uninstrument() restores the original methods. examples/embed_and_rerank.py provides a runnable embedding and reranking example.
The following methods are supported on both clients:
Each public call produces one span, including an entire nested batch and the client's own retries. The span is a child of the active span and remains current while the SDK sends its request, so HTTP instrumentation can nest underneath it. Local models run by embed are traced without server.address.
The deprecated module functions voyageai.get_embedding(s) / aget_embedding(s) and the TypeScript client are not covered. traceAI-openai does not instrument voyageai.Client; use this package rather than an OpenAI wrapper for these calls.
Contextualized counts come from the returned nested result, so client-side or server-side chunking does not confuse document count with embedding count. Vectors and returned chunk text are never exported.
Disable any other instrumentor wrapping the same Voyage methods to avoid duplicate spans and usage. Framework-level parent spans may report their own token totals.
from fi_instrumentation import TraceConfig # Use these options in your instrument() call instead of the default call above. VoyageInstrumentor().instrument( tracer_provider=trace_provider, capture_content=True, config=TraceConfig(pii_redaction=True), ) Embedding vectors, multimodal media payloads, media URLs and media object representations are never captured. With capture enabled, multimodal inputs retain their batch boundaries and text segments; media segments become [media omitted]. Contextualized inputs retain their document/chunk boundaries. Text supplied explicitly as text is treated as text, even if it contains a URL.
Nested capture is limited to 64 outer groups and 64 segments in total, with each text capped at 2 KB of UTF-8. Ordinary embedding texts, rerank documents and scores are limited to 64 items each. Counts and usage remain exact.
Known client API keys are redacted from captured content and exported error messages. PII redaction is pattern-based: review your capture settings for the sensitivity of your data. The core redactor can also match long numeric scores; use hide_outputs=True if you do not need scores in traces.
Cancelling an async call or interrupting a blocking call ends its span with voyage.cancelled=true and no exception event. Instrumentation failures do not change the SDK's return value or raised exception.
The instrumentor never changes base_url. The SDK selects its host from your key; an explicit base_url on the client takes precedence. Set any required regional host on the client, not the instrumentor. A failed request does not cause the instrumentor to retry against another host.
instrument(config=...) requires a TraceConfig; capture_content must be a boolean. Invalid option types raise TypeError before wrapping any method. OpenTelemetry's dependency check prevents instrumentation outside the supported SDK version range.
traceai futureagi opentelemetry tracing observability llm voyage
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
None of the files in this release were uploaded with provenance metadata.
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.




