3tears-models
LangChain-native AI model factories for the 3tears framework. Build chat and embedding models from a single call, with capability metadata, circuit breakers, error translation, and usage tracking wired in.
pip install 3tears-models
What you get
- Factories --
create_chat_model()andcreate_embedding_model()return standard LangChainBaseChatModel/Embeddingsinstances. No custom runtime protocols to learn. - Providers -- Anthropic, OpenAI, OpenRouter, VoyageAI, Whisper, and image backends (OpenAI Images, HuggingFace, A1111, ModelsLab, ComfyUI).
- Capability registry --
get_capabilities(),register_capabilities(), and per-model overrides describe context windows, vision support, tool support, and tier. - Circuit breakers --
CircuitBreakerandCircuitBreakerRegistrytrip on repeated provider failures and recover on a timer. - Usage tracking --
UsageTracker.record()emits an OpenTelemetry span plus Prometheus instruments, with optional per-application audit and counter sinks. - Message hygiene --
preprocess_messages(),enforce_alternating_roles(),filter_invalid_tool_calls(), and streaming chunk helpers (parse_chunk,merge_chunks).
Quickstart
from threetears.models import create_chat_model, create_embedding_model
chat = create_chat_model("claude-sonnet-4-6")
reply = await chat.ainvoke("Summarize three-tier caching in one sentence.")
embedder = create_embedding_model("voyage-3")
vectors = await embedder.aembed_documents(["first doc", "second doc"])
Capabilities, circuit breakers, and usage tracking attach automatically. Reach for the registry and tracker APIs directly when you need to inspect or override them.
License
MIT. See LICENSE.
Release files for 3tears-models 0.42.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| 3tears_models-0.42.0.tar.gz | 207.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 3tears_models-0.42.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 337.6 kB
Release files / 3tears_models-0.42.0.tar.gz
| Download URL | 3tears_models-0.42.0.tar.gz |
|---|---|
| Size | 207.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de098f621a9a7a3d7a2254aeeb4cdc8a62ddb5335b1841ae32d4ad3c005989bd
|
|
BLAKE2b-256 checksum How to use checksums |
14150ba8c0cf35e95d23748dc0b8fc96262a055308e03ad4304994b238ecae4f
|
| 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 Sep 15, 2026.
Transparency logRelease files / 3tears_models-0.42.0-py3-none-any.whl
| Download URL | 3tears_models-0.42.0-py3-none-any.whl |
|---|---|
| Size | 130.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c6e9eff02d7f337379873cb68ec2fcc1787ea6542d0f98dfbe003fd0545a8e6
|
|
BLAKE2b-256 checksum How to use checksums |
11dbacb43f60b67c01d18cdf079311e20103a3ca8d6c7a6d67c878caae47e860
|
| 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 Sep 15, 2026.
Transparency log