Skip to main content

jharness-models

OpenAI Chat (Chat Completions API), OpenAI Responses, and Anthropic Messages adapters, plus provider-neutral model composition for the JHarness kernel.

uv add jharness-models
from jharness.models.openai import OpenAIResponsesModel
Adapter Runtime tools Provider-hosted tools Ordered output
OpenAI Chat Function calls None Content and calls are normalized into ModelResponse.output
Anthropic Messages Client tool_use Official web-search preset Native block order is retained
OpenAI Responses Function and custom calls Official web-search and image-generation presets Native Responses item order is retained

Model modalities describe what the model itself understands or produces. Tool ownership is separate: RuntimeToolCall is executed by the JHarness runtime, while a ProviderToolCall records work already executed by the supplier. Both remain interleaved with ContentPart values in ordered output.

Each protocol profile contains the exact immutable ModelCapabilities returned by its model client. The default Responses and Messages profile classes remain provider-tool neutral. The official openai_responses_profile() and anthropic_messages_profile() factories install their hosted-tool identities and capabilities, but do not add a tool to any request. Hosted-tool mapping is a closed, protocol-owned union; profiles cannot inject custom wire codecs. The host must still pass an explicit ProviderToolSpec factory result to Runtime, and selecting an official profile is the host's confirmation that the chosen endpoint and model support its advertised capabilities. Tool selection is declared as a set of supported types rather than a coarse boolean. Supplier factories only compose protocol capabilities and wire policies; each adapter emits only its documented protocol wire.

Capabilities are host assertions rather than live endpoint discovery. JHarness blocks requests outside the selected profile, but an overstated profile may still reach a provider that rejects, ignores, or degrades the claimed feature. Use an exact, model-appropriate profile. Image MIME ArtifactRef values count as image inputs: Responses emits input_image, Anthropic Messages emits an image file source, and Chat uses the standard nested file content part and therefore also requires file input.

from jharness.kernel import Runtime
from jharness.models.openai import (
    OpenAIResponsesModel,
    openai_responses_profile,
    openai_responses_web_search,
)

model = OpenAIResponsesModel(..., profile=openai_responses_profile())
runtime = Runtime(
    model=model,
    provider_tools=(openai_responses_web_search(),),
)

OpenAI Responses sends store=false by default and requests encrypted reasoning history; assistant and reasoning history is replayed only from complete native Responses output items. Hosted image generation additionally requires a host-owned OpenAIResponsesArtifactStore; generated base64 is persisted externally and durable history contains only integrity-bearing ArtifactRef values. Stores must be durable, idempotent, safe for provider-controlled call ids, available during run recovery, and responsible for retention and garbage collection of uncommitted saves.

Retry and fallback compose directly around model values:

from jharness.models.decorators import FallbackModel, RetryingModel

model = FallbackModel(
    RetryingModel(primary_model, max_attempts=3),
    RetryingModel(backup_model, max_attempts=2),
)

Installing this distribution installs the exact matching jharness-kernel version. Provider configuration and composition details are in the model adapter guide.

Metadata

Release files for jharness-models 0.9.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 jharness-models 0.9.0
File Size Uploaded Provenance Actions
jharness_models-0.9.0.tar.gz 73.6 kB With provenance Details for jharness_models-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jharness-models 0.9.0
File Interpreter ABI Platform Actions
jharness_models-0.9.0-py3-none-any.whl Python 3 none any Details for jharness_models-0.9.0-py3-none-any.whl

Total release size: 167.4 kB

Release files / jharness_models-0.9.0.tar.gz

Download URL jharness_models-0.9.0.tar.gz
Size 73.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d99512a44beeed389a7b9f9e30436b094dbbd3f127251e31c345a3213a93ca10
BLAKE2b-256 checksum
How to use checksums
5812d8b9702db14abae018719b0afebb456f8b8147eb86f65a38082ab690818a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 30, 2026.

Transparency log

Release files / jharness_models-0.9.0-py3-none-any.whl

Download URL jharness_models-0.9.0-py3-none-any.whl
Size 93.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cce9798f16397867ad9a0fdd98a3517ebf0f301414bd39078fcaf12232fa187
BLAKE2b-256 checksum
How to use checksums
9cec0b7e846e1a152218fee15cf821a66ee0166c9e751eacdd455201e4d41823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 30, 2026.

Transparency log

Security for jharness-models 0.9.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jharness_models-0.9.0.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 Aug 30, 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.

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