LangChain-native AI model factories with capability metadata, circuit breakers, and usage tracking for the 3tears platform
pip install 3tears-models==0.67.0 Copy PIP instructions
pip install 3tears-models What you get Factories -- create_chat_model() and create_embedding_model() return standard LangChain BaseChatModel / Embeddings instances. 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 -- CircuitBreaker and CircuitBreakerRegistry trip on repeated provider failures and recover on a timer. The factory's default breaker is per provider and per API key, so one caller's failing key never fast-fails another key on the same provider. 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.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.




