Skip to main content

querymt

Python bindings for QueryMT.

Install

From the repository root:

python -m venv .venv
source .venv/bin/activate
pip install maturin
maturin develop --manifest-path crates/py/querymt-py/Cargo.toml

Then verify the module imports:

python -c "import querymt; print(querymt.__all__)"

Quick Start

import asyncio
import querymt


async def main() -> None:
    registry = await querymt.Registry.default()
    provider = await registry.provider("openai", model="gpt-4o-mini")
    response = await provider.chat([
        {"role": "user", "content": "Say hello briefly."}
    ])
    print(response.text)


asyncio.run(main())

Examples

  • crates/py/querymt-py/examples/chat.py
  • crates/py/querymt-py/examples/stream_chat.py
  • crates/py/querymt-py/examples/tools_chat.py
  • crates/py/querymt-py/examples/tools_stream_chat.py
  • crates/py/querymt-py/examples/share_provider.py
  • crates/py/querymt-py/examples/remote_chat.py

Tool Calling

You can pass tool definitions as plain Python dictionaries matching QueryMT's Tool schema:

TOOLS = [
    {
        "type": "function",
        "function": {
            "name": "lookup_weather",
            "description": "Look up the current weather for a city.",
            "parameters": {
                "type": "object",
                "properties": {
                    "city": {
                        "type": "string",
                        "description": "City name"
                    }
                },
                "required": ["city"],
            },
        },
    }
]

Use them with chat_with_tools(...) or chat_stream_with_tools(...).

Helper Builders

The module also exposes small helper builders:

  • querymt.user_message(...)
  • querymt.assistant_message(...)
  • querymt.text_block(...)
  • querymt.image_block(...)
  • querymt.image_url_block(...)
  • querymt.pdf_block(...)
  • querymt.audio_block(...)
  • querymt.thinking_block(...)
  • querymt.tool_use_block(...)
  • querymt.tool_result_block(...)
  • querymt.resource_link_block(...)
  • querymt.function_tool(...)

Metadata

Release files for querymt 0.5.2

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

Source distribution (sdist)

Source distribution for querymt 0.5.2
File Size Uploaded Provenance Actions
querymt-0.5.2.tar.gz 432.3 kB With provenance Details for querymt-0.5.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for querymt 0.5.2
File Actions
querymt-0.5.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for querymt-0.5.2-cp310-abi3-win_amd64.whl
querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 95.9 MB

Release files / querymt-0.5.2.tar.gz

Download URL querymt-0.5.2.tar.gz
Size 432.3 kB
Tags Source
SHA-256 checksum
How to use checksums
62e4c4ef002c458ddafcb287a98b6fed9125e76b0d64cae74978c9fabd01743e
BLAKE2b-256 checksum
How to use checksums
9b894e7ae3c729500aa80e4ca2c309417f7c80bbe075f72d0d78d372ae5a0451
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / querymt-0.5.2-cp310-abi3-win_amd64.whl

Download URL querymt-0.5.2-cp310-abi3-win_amd64.whl
Size 20.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7e3e12ff610ba3ac45b411488675720a3bc913b14aac1ec7f3bf6a332228128e
BLAKE2b-256 checksum
How to use checksums
cfc39f5c7370c2ea474c82c9bcee6f30a68d98c912c35d963a4e7bb3a5fa6f2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL querymt-0.5.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 26.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
005bfd45b5c8cb991fb1a4db0edcb5847381d3a2292285e23a49672b2b045e60
BLAKE2b-256 checksum
How to use checksums
1e9cf082a67ef0097de9cbac3a0904d1265f49a68cc73d7bf7cf84585b9cd4d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL querymt-0.5.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 26.2 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1cc172c14872a2d7d351b4dec43007282300efb2f6587d7580c60fc13a8c5950
BLAKE2b-256 checksum
How to use checksums
3df7b3c848751277c82059b9a4815af2425adf389d6b3e953089583f189798a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL querymt-0.5.2-cp310-abi3-macosx_11_0_arm64.whl
Size 22.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2c1ec96f9fd43943dfce7ba1205a3946e415fa28a08d3b87b18e1b8ce65a37db
BLAKE2b-256 checksum
How to use checksums
ce40053f014bc56baf44de9e9929f962098083393d3e9c877a0082bbe57cc07d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Security for querymt 0.5.2

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for querymt-0.5.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

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.5.2 This release

5 release files Full 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