Skip to main content

Install the SDK

The Zyonix SDK is a Python package, zyonix-sdk. You import it as zyonix. It records what your application does with each document and sends it to Zyonix in the background.

Requirements​

  • Python 3.10 or newer (3.10 to 3.14 are supported).
  • Outbound HTTPS from where your application runs to your Zyonix address, for example https://zyonix.example.com.
  • An sdk API key, created by an administrator on the Zyonix website under Team → API keys. You need it to send documents, not to install the package or to try it locally.

The SDK depends on:

PackageVersionWhy
pydantic2.7 or newer, below 3reads and validates zyonix.yaml
httpx0.27 or newer, below 1sends data to Zyonix
opentelemetry-api, opentelemetry-sdk, opentelemetry-proto, opentelemetry-exporter-otlp-proto-common1.45.2 or newer, below 2the trace format (internal; you never use it directly)
pyyaml6 or newerreads zyonix.yaml
zyonix-modelthe same version as zyonix-sdkshared definitions and the redaction rules; installed automatically

Install with pip​

Install the SDK with the extra that matches the LLM library your application uses. The extra adds automatic recording of that library's calls (prompts, answers, model names, token counts):

pip install "zyonix-sdk[openai]"

The quotes stop your shell from reading the square brackets.

ExtraFor applications that useInstalls
openaithe openai package (also OpenAI-compatible providers called through it, such as Azure OpenAI or OpenRouter)openinference-instrumentation-openai
anthropicthe anthropic packageopeninference-instrumentation-anthropic
langchainLangChain (langchain-core)openinference-instrumentation-langchain
llama-indexLlamaIndex (llama-index-core)openinference-instrumentation-llama-index
litellmLiteLLMopeninference-instrumentation-litellm
bedrockAWS Bedrock through boto3 / botocoreopeninference-instrumentation-bedrock

Several libraries? Combine extras: pip install "zyonix-sdk[openai,anthropic]".

Another library, or your own HTTP calls to a model? Install without an extra:

pip install zyonix-sdk

You still get every document, its steps, their inputs, outputs, errors and timing. Only the separate record of each model call (and its token counts) is missing. See LLM libraries.

Pin the version​

Pin a range in your dependency file so an upgrade happens only when you choose it:

# requirements.txt
zyonix-sdk[openai]>=0.1.13,<0.2

The <0.2 bound keeps you on the 0.1 series. Read the release notes before you move to a newer series.

Install with uv or Poetry​

# uv (a project with pyproject.toml)
uv add "zyonix-sdk[openai]>=0.1.13,<0.2"

# Poetry
poetry add "zyonix-sdk[openai]>=0.1.13,<0.2"

# pipenv
pipenv install "zyonix-sdk[openai]>=0.1.13,<0.2"

Or write the dependency into pyproject.toml yourself:

[project]
dependencies = [
"zyonix-sdk[openai]>=0.1.13,<0.2",
]
# Poetry's own table
[tool.poetry.dependencies]
zyonix-sdk = { version = ">=0.1.13,<0.2", extras = ["openai"] }

In a Docker image, add the line to the requirements file your Dockerfile already installs, and rebuild the image.

Packages received as files

If your Zyonix contact gave you the packages as a bundle of files instead of an index, use the install command that came with the bundle, and do not also install zyonix-sdk from another index: pip must not mix the two sources.

The zyonix command​

Installing the SDK also installs a zyonix command with two subcommands:

CommandWhat it does
zyonix doctorChecks your configuration, the connection and the key, and sends one test document. See Testing locally.
zyonix initWrites a commented starter zyonix.yaml (see Configuration).

That is all a running application needs.

The CLI for developers and CI​

The terminal commands that read results (zyonix status, zyonix runs, zyonix issues, zyonix test, zyonix replay and more) are a separate package, zyonix-cli. It adds them to the same zyonix command. Install it on developer machines and in CI, not necessarily in your production image:

pip install zyonix-cli
pip install "zyonix-cli[mcp]" # optional: `zyonix mcp`, for coding agents that speak MCP

zyonix-cli requires the same version of zyonix-sdk. The CLI signs in as a person (zyonix login) or uses a cli key, never the application's sdk key.

Check the install​

python -c "import zyonix; print(zyonix.__version__)"
pip check
zyonix doctor
  1. The first line prints the version, for example 0.1.13.
  2. pip check must say No broken requirements found.
  3. zyonix doctor checks the setup. Without a key and without local mode, it stops at tracing is off: that is expected before you have configured anything. With a key and ZYONIX_ENDPOINT set it must end with all checks passed.

Dependency conflicts​

The SDK needs pydantic 2.7+, httpx 0.27+ and OpenTelemetry 1.45.2+. If your environment has older versions, pip upgrades them without asking. Before you install into an existing environment, see what would change:

pip install --dry-run "zyonix-sdk[openai]"

Read the Would install line. Common cases:

Your project hasWhat happensWhat to do
pydantic 1.x pinnedpip cannot install the SDK (or would upgrade pydantic to 2 and break your code)Migrate the project to pydantic 2 first, or keep Zyonix out of this environment
httpx below 0.27 pinnedinstall failsRaise the pin to httpx>=0.27,<1 and run your tests
OpenTelemetry 1.x below 1.45.2 (for example from another tracing tool)pip upgrades itUsually safe within 1.x; run your tests, and check the other tool's supported range
Another tracing tool that installs its own openinference-instrumentation-*the instrumentations are sharedFine. Zyonix keeps its own private tracer; see LLM libraries
Another package named zyoniximport zyonix loads the wrong oneUse a separate virtual environment

After installing, run your application's own tests. The SDK does nothing until zyonix.init() is called with a key or a local mode, so the tests behave exactly as before.

Next​