Skip to main content

idun-sdk

PyPI version Python License: MIT Offline tests Providers CI Docs GitHub

A thin, dependency-free Python client + CLI for Azure AI Foundry agents (Idun / NatureLM) and any OpenAI-compatible endpoint. Tenant-agnostic by design: bring your own Foundry resource — no hardcoded tenant coordinates.


Install

pip install idun-sdk
# with optional PDF ingest:
pip install "idun-sdk[pdf]"   # pulls PyPDF2

Quick start (SDK)

from idun import IdunClient

client = IdunClient()                 # reads ~/.idun/config.toml
out = client.complete("Summarize the quarterly risk report.")
print(out["text"])

Two CLIs — two separate setup wizards (intentionally, not one)

This package ships two command-line tools with distinct purposes. They are intentionally kept separateidun is the Azure AI Foundry client, idun-multi is the multi-provider LLM console. There is no unified idun-wizard; each tool has its own first-run setup wizard:

  • idun — the Azure AI Foundry client. Agent completions, trajectory export, document matrix (idun matrix), prompt packs (idun run / idun packs), and Hugging Face Hub operations (idun hf). Azure-specific.
    • idun wizard configures the Azure Foundry client (endpoint / project / agent) in ~/.idun/config.toml.
  • idun-multi — the multi-provider LLM console. Talks to any of the 17 registered providers (OpenAI, Anthropic, Groq, OpenRouter, HF, …) plus race, cost, models, doctor, support. Provider-agnostic.
    • idun-multi wizard configures the default LLM provider (picks one of the 17 registered providers and prints the provider table so you can choose) in ~/.idun/config.toml.

Both wizards write only to ~/.idun/config.toml (never ~/.idunrc, which is no longer used). Credentials live in per-provider ~/.idun/<id>.token files (0600).

idun-multi providers        # list providers + credential status
idun-multi -p openrouter ask "hello"   # -p goes BEFORE the subcommand
idun-multi race "explain quantum"      # compare providers on one prompt
idun-multi doctor            # environment + credential audit (also checks scripts)
idun-multi wizard            # pick the default LLM provider
idun wizard                  # configure the Azure Foundry client

Async

import asyncio
from idun import AsyncIdunClient

async def main():
    c = AsyncIdunClient()
    out = await c.acomplete("What changed vs last quarter?")
    print(out["text"])

asyncio.run(main())

CLI

idun — Azure AI Foundry client:

idun chat "your prompt"        # one-shot completion
idun trace "your prompt"       # full agent trajectory (steps)
idun export "your prompt" -o trace.md   # run + save trajectory (json/md)
idun token                     # inspect / rotate stored Entra token
idun login                     # device-code login to your Foundry (azure/hf/openai)
idun status                    # show resolved backend + credential state
idun run <pack> <key>          # run a bundled prompt pack
idun packs                     # list bundled prompt packs
idun matrix  --docs DIR --questions FILE   # Doc x Question pivot (IDEA α)
idun diff-docs --doc-a A --doc-b B --topics T  # clause-drift compare (IDEA γ)
idun diff "A" "B"              # compare two prompt trajectories side-by-side
idun hf whoami|status|push     # Hugging Face Hub operations
idun openapi                   # print the bundled OpenAPI 3 spec for the completion API
idun logo                      # show bundled Foundry logo paths
idun welcome                   # ASCII banner
idun wizard                    # configure the Azure Foundry client

idun-multi — multi-provider LLM console (-p <provider> goes BEFORE the subcommand):

idun-multi providers          # list providers + credential status
idun-multi -p openrouter ask "hello"   # chat with a provider
idun-multi race "explain quantum"      # compare providers on one prompt
idun-multi models              # list models (or --discover)
idun-multi cost                # token / cost estimate
idun-multi doctor              # environment + credential audit
idun-multi verify              # LIVE smoke-test configured providers
idun-multi wizard              # pick the default LLM provider
idun-multi review <pr> [--post] [--inline] [--labels] [--no-cache]
                             # self-built PR reviewer (diff -> race -> artifacts)

Live provider verification (idun-multi verify)

The support matrix is honest about capability (which transport is wired), but not about whether a provider has actually answered a request lately. idun-multi verify performs a real, minimal API call against every provider that has a credential configured, and records the outcome in ~/.idun/.verified.json (no secrets — only status, model, latency, and a redacted error on failure). Unconfigured providers are reported as skip, never fail, so an unconfigured machine shows an honest "not checked" rather than a wall of false failures.

The recorded state feeds the Live column of idun-multi support and is refreshed automatically every time you run race or verify. A provider with Declared = — and Live = ? is simply unproven on this install — not claimed broken, not claimed working.

idun-multi verify                       # all providers with a credential
idun-multi verify --providers openai,groq,anthropic

Self-built PR reviewer (idun-multi review)

A self-hosted alternative to CodeRabbit (ROADMAP Open #4). It fetches the PR diff via gh, splits it into chunks, races them across up to 3 providers that have credentials, and turns the results into actionable artifacts:

idun-multi review 123                      # dry-run, prints findings
idun-multi review 123 --post              # also post a PR comment
idun-multi review 123 --inline            # post inline comments (GraphQL)
idun-multi review 123 --labels --post     # add severity labels to the PR
idun-multi review 123 --no-cache          # re-run all providers

Findings are parsed into severity/file/line and deduplicated across providers. Chunk results are cached under ~/.idun/.review_cache.json (no secrets) so repeat runs are cheap.

Supported providers

The idun CLI / IdunClient speak to any OpenAI-compatible endpoint plus the native Azure AI Foundry transport. Registered providers (4 groups):

  • OpenAI-compatible: openai, groq, together, perplexity, fireworks, novita, xai, deepseek, mistral, openrouter, gemini, hf, nous
  • Anthropic: anthropic (Claude)
  • Azure: azure (Azure AI Foundry / Idun agent)
  • Local: ollama, local (bring your own endpoint)

Each provider's capabilities (streaming, tools, vision, JSON mode) are derived from the transports actually implemented in idun/providers.py — see SUPPORT_MATRIX.md for the full, code-generated matrix and per-transport capability details.

Hugging Face (hf): uses the OpenAI-compatible router https://router.huggingface.co/v1 (the legacy api-inference.huggingface.co host was retired). Requires an HF token (HF_TOKEN).

Any OpenAI-compatible base URL works with zero code changes — set it in the config and the provider switches automatically.

Configuration (tenant-agnostic)

~/.idun/config.toml (neutral defaults — supply your own resource). Secrets go to per-provider ~/.idun/<id>.token files (mode 0600), not in this file:

# Written by `idun-multi wizard` (LLM provider default):
[defaults]
provider = "openrouter"

[openrouter]
model = "deepseek/deepseek-chat"

# Written by `idun wizard` (Azure AI Foundry client):
[azure]
base   = "https://YOUR-RESOURCE.services.ai.azure.com"
agent  = "your-agent-name"
project = "your-project"

No tenant coordinates are baked into the shipped code. The CLI reads the config via idun.config; environment variables (IDUN_PROVIDER, OPENAI_API_KEY, …) always win over the file.

Additional features

These build on the core SDK and live in idun.matrix / the playground repo.

Idun Matrix — Doc × Question pivot (IDEA α)

Build an N × M answer matrix over documents × questions. Each cell carries the answer, the source citation, and a status (GREEN = answered+cited, RED = contradiction, GRAY = no info).

idun matrix --docs ./contracts --questions ./questions.txt

Clause Drift compare (IDEA γ)

Compare two documents across topics and flag deviations:

idun diff-docs --doc-a contract_a.txt --doc-b contract_b.txt --topics topics.txt

PocketPal-style Bridge (IDEA β)

A tenant-agnostic mobile web UI that runs idun matrix against your Foundry resource: https://qapdex-maker.github.io/idun-playground/matrix_app.html

Links

Development

pip install -e ".[dev]"
pytest        # offline; no network/API keys required
ruff check .  # lint (pinned ruff==0.15.10 in CI)

License

MIT.

Release files for idun-sdk 1.0.34

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

Source distribution (sdist)

Source distribution for idun-sdk 1.0.34
File Size Uploaded
idun_sdk-1.0.34.tar.gz 146.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for idun-sdk 1.0.34
File Interpreter ABI Platform
idun_sdk-1.0.34-py3-none-any.whl Python 3 none any Details

Total release size: 252.7 kB

Release files / idun_sdk-1.0.34.tar.gz

Download URL idun_sdk-1.0.34.tar.gz
Size 146.5 kB
Tags Source
SHA-256 checksum
How to use checksums
749cdaa5a7006f0eecd8e5b26fcaead01e04b01d48462b86b3f6b413bda97a07
BLAKE2b-256 checksum
How to use checksums
eaa73f81c311f2d0f62cfa4dba6bb4cc792804781d5863a09430658ae63aa2c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / idun_sdk-1.0.34-py3-none-any.whl

Download URL idun_sdk-1.0.34-py3-none-any.whl
Size 106.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
871fb75543e74da5a021ab73345c4b0808bfc0b5a801c140ec88014ed15beb1e
BLAKE2b-256 checksum
How to use checksums
90d06c5745150c406681ca2f5875e56757b8dd45065716a7ab0cc69537e02ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.0.34 This release

2 release files

1.0.33

2 release files

1.0.32

2 release files

1.0.31

2 release files

1.0.30

2 release files

1.0.29

2 release files

1.0.28

2 release files

1.0.27

2 release files

1.0.26

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.16

1 release file

1.0.15

1 release file

1.0.14

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.11

1 release file

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.38

2 release files

0.1.37

2 release files

0.1.36

2 release files

0.1.35

2 release files

0.1.34

2 release files

0.1.33

2 release files

0.1.32

2 release files

0.1.31

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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