Skip to main content

traceAI-alephalpha

OpenTelemetry instrumentation for the Aleph Alpha Python SDK (aleph-alpha-client, import aleph_alpha_client).

pip install traceAI-alephalpha
from aleph_alpha_client import Client, CompletionRequest, Prompt
from fi_instrumentation import register
from traceai_alephalpha import AlephAlphaInstrumentor

AlephAlphaInstrumentor().instrument(tracer_provider=register(project_name="my-project"))

client = Client(token="...", host="https://inference-api.your.domain")
client.complete(CompletionRequest(prompt=Prompt.from_text("Hello"), maximum_tokens=16), model="luminous-base")

With fi-instrumentation-otel auto-instrumentation the alephalpha integration is enabled whenever aleph_alpha_client is installed.

What is traced

On Client and AsyncClient (sync and async):

SDK call Span Kind
complete alephalpha.text_completion LLM
chat alephalpha.chat LLM
evaluate alephalpha.evaluate LLM
embed, embeddings, semantic_embed, batch_semantic_embed, instructable_embed alephalpha.embeddings EMBEDDING
AsyncClient.complete_with_streaming, AsyncClient.chat_with_streaming alephalpha.text_completion, alephalpha.chat LLM

Each span carries gen_ai.provider.name = aleph_alpha, the request model, max tokens / temperature / top_p / top_k / penalties / stop sequences, the response model, finish reasons and token usage when the response carries it. Tool calls the model makes are recorded on the output message. Embedding vectors are never recorded. Token usage comes from what the SDK returns: a non-streaming chat response has none (the SDK drops it), a stream reports it when stream_options.include_usage is set.

  • Only the outermost SDK call is traced; calls an SDK method makes into other traced methods do not produce extra spans.
  • Streams end on exhaustion, error or aclose(); an early exit is marked alephalpha.stream.incomplete. A stream that is dropped without being read or closed also ends its span.
  • Exceptions are re-raised unchanged and recorded as ERROR with error.type (the class name); the message is never exported.
  • Inputs and outputs follow the TraceConfig hide settings. Only text prompts and plain-text chat messages are captured as input.value; images and token-id prompts are never exported.
  • A failure inside the instrumentation never breaks the SDK call.

Supported SDK range: aleph-alpha-client >= 7.6.0, < 12. Methods an SDK version does not have (for example embeddings in older releases) are skipped.

Metadata

Release files for traceAI-alephalpha 0.1.0

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

Source distribution (sdist)

Source distribution for traceAI-alephalpha 0.1.0
File Size Uploaded Provenance Actions
traceai_alephalpha-0.1.0.tar.gz 7.0 kB Without provenance Details for traceai_alephalpha-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traceAI-alephalpha 0.1.0
File Interpreter ABI Platform Actions
traceai_alephalpha-0.1.0-py3-none-any.whl Python 3 none any Details for traceai_alephalpha-0.1.0-py3-none-any.whl

Total release size: 14.8 kB

Release files / traceai_alephalpha-0.1.0.tar.gz

Download URL traceai_alephalpha-0.1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f23bfd173023124edfcb7d5fa2aabb1a914cde3242b34640739fe76a8ded797
BLAKE2b-256 checksum
How to use checksums
aad0dcf84fea840780fec33da82cb52a701c0dc304afb080c95d5be23e120389
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / traceai_alephalpha-0.1.0-py3-none-any.whl

Download URL traceai_alephalpha-0.1.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2355414a9bc3b2856cac1b629ac7feb292dc2178d7faa58011934498b63dd49d
BLAKE2b-256 checksum
How to use checksums
c62e10150027c1686294f955fe455c28cdebc95cb14059f5022f8b9f906bc467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for traceAI-alephalpha 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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