Metadata-Version: 2.4
Name: luxand-llm
Version: 1.0.0
Summary: Pure Python ctypes wrapper for the Luxand LLM SDK
Author: Luxand
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://www.luxand.com/
Project-URL: Repository, https://github.com/Luxand/luxand-llm-sdk
Project-URL: Issues, https://github.com/Luxand/luxand-llm-sdk/issues
Keywords: llm,local-llm,gguf,luxand
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Luxand LLM Python Wrapper

This is the supported, pure Python `ctypes` wrapper over the public
`LuxandLLMSDK.h` C ABI. It does not bundle native binaries. To run model
operations, download a matching Luxand LLM SDK native package separately and
point the wrapper at that package with `LUXLLM_NATIVE_PATH` or
`configure_native_library(...)`. This wrapper requires native ABI 0.6 or newer;
the guard runs before full native binding/model work.

Install the wrapper version matching the SDK release:

```bash
python -m pip install luxand-llm==1.0.0
```

Contributors testing an edited checkout should install that source explicitly:

```bash
python -m pip install -e ./wrappers/python
```

Point the wrapper at an unpacked Luxand LLM SDK native package before loading a
model:

```python
import luxand_llm as luxllm

luxllm.configure_native_library("/path/to/sdk/bin")
luxllm.activate_library()

with luxllm.Model("/path/to/model.gguf") as model:
    with model.create_engine(luxllm.Params().set("MaxParallelSessions", 1)) as engine:
        with engine.create_session() as session:
            session.add(luxllm.Role.USER, "Write one sentence about Paris.")
            result = session.generate(luxllm.Params().set("MaxTokens", 64))
            print(result.text)
```

For caller-driven batching, `session.start()` + `engine.step()` +
`session.read_text()` mirrors the C pull API. Reads return `CHUNK`, `NONE`,
`FINISHED`, or `FAILED`. A session-local runtime failure is a terminal `FAILED`
read and does not interrupt healthy siblings; a shared engine/backend failure
raises from `engine.step()`. High-level generate/stream/batch APIs still raise
for their own failed request.

Native loading search order:

1. `configure_native_library(path)` or `load_native(path)`.
2. `LUXLLM_NATIVE_PATH`.
3. Package-adjacent library locations.
4. The platform loader path.

Links:

- [Luxand LLM SDK on GitHub](https://github.com/Luxand/luxand-llm-sdk) —
  runnable Python lessons under `samples/python/`, SDK downloads on Releases
- [Developer Manual](https://luxand.com/llm-sdk/documentation/) — concepts and
  the full API reference
- [luxand.com/llm-sdk](https://luxand.com/llm-sdk) — product page ·
  [benchmarks](https://luxand.com/llm-sdk/benchmarks) ·
  [pricing](https://luxand.com/llm-sdk/pricing)
