LangChain-native AI model factories with capability metadata, circuit breakers, and usage tracking for the 3tears platform
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file 3tears_models-0.15.0.tar.gz.
File metadata
- Download URL: 3tears_models-0.15.0.tar.gz
- Upload date:
- Size: 136.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44f29d6c321c4932d2b702b9327a5176c8f6378d759a5a5ac30a7b5fd50dc6e7
|
|
| MD5 |
393c10e57a18fc0e4cc717ccdf84fc5b
|
|
| BLAKE2b-256 |
10765d18571e382c46e1851bdb71abedcfd9114fa2636a580fd8f5622ec84a0f
|
Provenance
The following attestation bundles were made for 3tears_models-0.15.0.tar.gz:
Publisher:
release.yml on pacepace/3tears
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3tears_models-0.15.0.tar.gz -
Subject digest:
44f29d6c321c4932d2b702b9327a5176c8f6378d759a5a5ac30a7b5fd50dc6e7 - Sigstore transparency entry: 2157047327
- Sigstore integration time:
-
Permalink:
pacepace/3tears@6ba17c2c246cc2768e3deaf3d936c9c03d5b2c4f -
Branch / Tag:
refs/tags/v0.15.0 - Owner: https://github.com/pacepace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6ba17c2c246cc2768e3deaf3d936c9c03d5b2c4f -
Trigger Event:
push
-
Statement type:
File details
Details for the file 3tears_models-0.15.0-py3-none-any.whl.
File metadata
- Download URL: 3tears_models-0.15.0-py3-none-any.whl
- Upload date:
- Size: 89.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaccc6a578c4ff537168372eb150158a388d51206fe191102b96be188e22ca27
|
|
| MD5 |
b4a1c8f7801eeb5437bc10ab15b67f7d
|
|
| BLAKE2b-256 |
cfa87c83075810bae876a2497b505f36cf8084cd30b03b24222f004a0bd56ad0
|
Provenance
The following attestation bundles were made for 3tears_models-0.15.0-py3-none-any.whl:
Publisher:
release.yml on pacepace/3tears
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3tears_models-0.15.0-py3-none-any.whl -
Subject digest:
aaccc6a578c4ff537168372eb150158a388d51206fe191102b96be188e22ca27 - Sigstore transparency entry: 2157048354
- Sigstore integration time:
-
Permalink:
pacepace/3tears@6ba17c2c246cc2768e3deaf3d936c9c03d5b2c4f -
Branch / Tag:
refs/tags/v0.15.0 - Owner: https://github.com/pacepace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6ba17c2c246cc2768e3deaf3d936c9c03d5b2c4f -
Trigger Event:
push
-
Statement type: