Metadata-Version: 2.4
Name: tai42-kit
Version: 0.1.0
Summary: Generic leaf helpers, settings primitives, pooled clients, and LLM/AI factories for the TAI ecosystem.
Author-email: tai42 <oss@tai42.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://tai42.ai
Project-URL: Repository, https://github.com/tai42ai/tai-kit
Project-URL: Issues, https://github.com/tai42ai/tai-kit/issues
Project-URL: Changelog, https://github.com/tai42ai/tai-kit/blob/main/CHANGELOG.md
Keywords: llm,langchain,langgraph,mcp,utilities,settings
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: tai42-contract<0.2,>=0.1
Requires-Dist: pydantic>=2.12
Requires-Dist: pydantic-settings>=2.11
Requires-Dist: python-dotenv>=1.0
Requires-Dist: fastmcp<4,>=3.2
Requires-Dist: mcp>=1
Requires-Dist: anyio>=4
Requires-Dist: httpx>=0.28
Requires-Dist: httpcore>=1
Requires-Dist: ruamel.yaml>=0.18
Requires-Dist: PyYAML>=6
Requires-Dist: jsonschema>=4
Provides-Extra: llm
Requires-Dist: langchain<2,>=1.2; extra == "llm"
Requires-Dist: langchain-core<2,>=1.2; extra == "llm"
Requires-Dist: langchain-openai>=1.3; extra == "llm"
Requires-Dist: langgraph<2,>=1.1; extra == "llm"
Requires-Dist: langgraph-checkpoint>=4.0; extra == "llm"
Requires-Dist: langgraph-checkpoint-redis>=0.5; extra == "llm"
Provides-Extra: jq
Requires-Dist: jq>=1.10; extra == "jq"
Provides-Extra: uvicorn
Requires-Dist: uvicorn>=0.43; extra == "uvicorn"
Provides-Extra: anthropic
Requires-Dist: tai42-kit[llm]; extra == "anthropic"
Requires-Dist: langchain-anthropic>=1.4; extra == "anthropic"
Provides-Extra: mistral
Requires-Dist: tai42-kit[llm]; extra == "mistral"
Requires-Dist: langchain-mistralai>=1.1; extra == "mistral"
Provides-Extra: google
Requires-Dist: tai42-kit[llm]; extra == "google"
Requires-Dist: langchain-google-genai>=4.2; extra == "google"
Provides-Extra: xai
Requires-Dist: tai42-kit[llm]; extra == "xai"
Requires-Dist: langchain-xai>=1.2; extra == "xai"
Provides-Extra: ollama
Requires-Dist: tai42-kit[llm]; extra == "ollama"
Requires-Dist: langchain-ollama>=1.0; extra == "ollama"
Provides-Extra: huggingface
Requires-Dist: tai42-kit[llm]; extra == "huggingface"
Requires-Dist: langchain-huggingface>=1.2; extra == "huggingface"
Requires-Dist: sentence-transformers>=5.3; extra == "huggingface"
Provides-Extra: langgraph-checkpoint-postgres
Requires-Dist: tai42-kit[llm]; extra == "langgraph-checkpoint-postgres"
Requires-Dist: langgraph-checkpoint-postgres>=3.0.5; extra == "langgraph-checkpoint-postgres"
Requires-Dist: psycopg[pool]>=3.3.2; extra == "langgraph-checkpoint-postgres"
Provides-Extra: langgraph-checkpoint-sqlite
Requires-Dist: tai42-kit[llm]; extra == "langgraph-checkpoint-sqlite"
Requires-Dist: langgraph-checkpoint-sqlite>=3.0.3; extra == "langgraph-checkpoint-sqlite"
Requires-Dist: aiosqlite>=0.20; extra == "langgraph-checkpoint-sqlite"
Provides-Extra: redis
Requires-Dist: redis>=5; extra == "redis"
Provides-Extra: curl
Requires-Dist: curl-cffi>=0.7; extra == "curl"
Provides-Extra: postgres
Requires-Dist: psycopg[binary,pool]>=3.3.2; extra == "postgres"
Provides-Extra: jwt
Requires-Dist: joserfc>=1.7; extra == "jwt"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-asyncio>=1.3; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: pyright>=1.1.389; extra == "dev"
Requires-Dist: joserfc>=1.7; extra == "dev"
Dynamic: license-file

# tai42-kit

[![CI](https://github.com/tai42ai/tai-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/tai42ai/tai-kit/actions/workflows/ci.yml)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)

Generic leaf helpers, settings primitives, pooled clients, and LLM/AI factories
for the TAI ecosystem. It provides the reusable building blocks the server is
composed from: data and text transforms, LangChain/FastMCP/MCP tool glue, the
pooled-client facade and concrete drivers (`redis`, `curl`, `mcp`, `postgres`,
`http`), the SSRF URL guard and safe download, MCP client transports over a UDS
socket, the settings machinery, LLM/embedding factories with checkpoint/store
backends, and logging setup. Heavier backends are gated behind extras and
imported lazily. Typed package (`py.typed`).

## Position in the ecosystem

TAI is an open-source runtime for MCP tools, agents, and workflows — the server
that hosts a capability and supplies the operational layer around it (manifest
loading, access control, OAuth connectors, background execution, monitoring,
storage, and human-in-the-loop steps).

Three packages; each depends only on the ones to its left:

```
tai42-contract  <--  tai42-kit  <--  tai42-skeleton
(interfaces)      (helpers)     (the server)
```

`tai42-kit` obeys the leaf rule: its only tai-* dependency is `tai42-contract`. It
implements the contract's `BaseClient` Protocol and consumes its manifest types;
among tai-* packages it depends on nothing else.

## Install

Requires **Python 3.13+**. Nothing is on PyPI yet, so install from source. Clone
this repo alongside `tai42-contract` — this repo's `[tool.uv.sources]` points at
`../tai-contract` — then add it as an editable dependency of the environment
that runs the server:

```bash
git clone https://github.com/tai42ai/tai-contract
git clone https://github.com/tai42ai/tai-kit
cd tai-skeleton   # or your own app checkout
uv add --editable ../tai-kit   # once published: uv add tai42-kit
```

Backends are gated behind extras, so install the ones you need — e.g. the
pooled-client drivers `tai42-kit[redis]`, `tai42-kit[postgres]`, `tai42-kit[curl]`, the
checkpoint/store backends `tai42-kit[langgraph-checkpoint-postgres]`,
`tai42-kit[langgraph-checkpoint-sqlite]`, and LLM-provider backends like
`tai42-kit[anthropic]`, `tai42-kit[google]`, `tai42-kit[mistral]`, `tai42-kit[xai]`,
`tai42-kit[ollama]`, `tai42-kit[huggingface]`.

## Development

```bash
uv sync --extra dev --extra llm --extra jq --extra uvicorn --extra redis --extra curl --extra postgres
uv run ruff check .
uv run pyright       # 0 errors; missing optional ML backends are warnings
uv run pytest        # optional-extra tests skip if their extra is absent
```

See `CONTRIBUTING.md` for the rules.

## Documentation

The whole platform — concepts, guides, and the generated reference — lives in
the unified documentation site:

- Layering & the contract/kit/skeleton split: https://tai42.ai/concepts/layering
- Python SDK reference (this package's public API): https://tai42.ai/reference/python-sdk

## License

Apache-2.0. See `LICENSE` and `NOTICE`.
