Metadata-Version: 2.4
Name: jammi-ai
Version: 0.34.0
Summary: The Python client for a Jammi engine (import `jammi`) — one connect() for local (embedded) and remote targets
Project-URL: Homepage, https://github.com/f-inverse/jammi-ai
Project-URL: Documentation, https://f-inverse.github.io/jammi-ai/
Project-URL: Repository, https://github.com/f-inverse/jammi-ai
Project-URL: Bug Tracker, https://github.com/f-inverse/jammi-ai/issues
Author: F-Inverse
License: Apache-2.0
Keywords: client,embeddings,grpc,inference,vector-search
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: grpcio>=1.80.0
Requires-Dist: protobuf>=6.31.1
Requires-Dist: pyarrow>=14
Requires-Dist: typing-extensions>=4.0
Provides-Extra: dev
Requires-Dist: cryptography>=42; extra == 'dev'
Requires-Dist: grpcio-tools==1.80.0; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: tomli>=2; (python_version < '3.11') and extra == 'dev'
Provides-Extra: embedded
Requires-Dist: jammi-ai-native==0.34.0; extra == 'embedded'
Description-Content-Type: text/markdown

# jammi-ai

The Python client (import `jammi`) for a [Jammi](https://github.com/f-inverse/jammi-ai)
engine — one `connect(target)` for local (embedded) and remote targets.

`jammi-ai` is the **base** client: a universal `py3-none-any` wheel that
links no candle/ML stack — just `grpcio` + `protobuf` + `pyarrow` — for
production where the engine runs behind a server. It also discovers the compiled
in-process engine as an OPTIONAL backend: `pip install jammi-ai[embedded]`
pulls `jammi-ai-native`, and then `connect("file://…")` resolves the local target
to an in-process engine (direct FFI) through the SAME front door. Absent the
extra, the base stays native-free and a `file://` target raises a truthful
`NoEmbeddedEngineError`.

## One front door

```python
import jammi

db = jammi.connect("https://engine.example.com")
db.add_source("patents", url="s3://corpus/patents.parquet", format="parquet")
db.generate_embeddings(source="patents", model="local:tiny_bert",
                       columns=["abstract"], key="id", modality="text")
q = db.encode_query(model="local:tiny_bert", query="quantum computing")
hits = db.search("patents", query=q, k=5)   # -> pyarrow.Table
```

`connect(target)` is the Python mirror of the Rust `Jammi::open(Target)`:
transport is config, not a code path.

## Authenticated channels

A bearer-protected endpoint is reached by attaching credentials to the channel
— the bearer rides the channel (attached once at connect), not threaded through
every call:

```python
from jammi import connect, BearerCredentials

db = connect("https://engine.example.com", credentials=BearerCredentials(token))
```

The same works on a plaintext `grpc://` target for local development. The
channel-level bearer covers the typed gRPC verbs; `db.sql()` (the Flight SQL
lane) does not yet carry it — tracked at
[issue #96](https://github.com/f-inverse/jammi-ai/issues/96).

| target | transport |
|---|---|
| `https://host` / `grpcs://host:8081` | secure remote |
| `http://host` / `grpc://host:8081` | plaintext remote |
| `file:///data` | in-process engine (direct FFI) with the `[embedded]` extra installed; otherwise raises `NoEmbeddedEngineError` pointing at `pip install jammi-ai[embedded]` |

Scaling local→remote is an env flip (`connect(os.environ["JAMMI_TARGET"])`)
with no code change. The lean deploy build and the embedded build are ONE
package — the same `import jammi`, `connect` unchanged — differing only by
whether the `[embedded]` extra is present.

## Generated from the canonical proto

The wire stubs under `jammi/_generated/` are generated from the same
`jammi.v1` proto the engine, npm client, and embed wheel speak — one source, no
parallel schema. Regenerate after a proto change:

```sh
pip install -e '.[dev]'
make generate
```
