Metadata-Version: 2.5
Name: sinapsis-infra
Version: 0.1.0
Summary: Hardware-aware runtime installation and infrastructure provisioning for Sinapsis.
Project-URL: Homepage, https://sinapsis.tech
Project-URL: Documentation, https://docs.sinapsis.tech/docs/latest
Project-URL: Tutorials, https://docs.sinapsis.tech/docs/latest/tutorials
Project-URL: Repository, https://github.com/SinapsisHub/sinapsis-hub
Project-URL: Issues, https://github.com/SinapsisHub/sinapsis-hub/issues
Project-URL: Discord, https://discord.gg/uuBqQqu2vS
Author-email: Ariel Ruiz-Garcia <ariel@sinapsis.tech>
Maintainer-email: sinapsis <dev@sinapsis.tech>
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.13
Requires-Dist: docker<8,>=7.2
Requires-Dist: packaging<27,>=25
Description-Content-Type: text/markdown

<h1 align="center">
<br>
<a href="https://sinapsis.tech/">
  <img
    src="https://github.com/SinapsisHub/brand-resources/blob/main/public/logo/sinapsis-logo-horizontal-dark-brand.png?raw=true"
    alt="Sinapsis"
    width="300">
</a>
<br>
Sinapsis Infra
<br>
</h1>

<h3 align="center">Hardware-aware runtime installation and infrastructure provisioning for Sinapsis.</h3>

<p align="center">
  <a href="#overview">Overview</a> &bull;
  <a href="#installation">Installation</a> &bull;
  <a href="#runtime-installation">Runtime Installation</a> &bull;
  <a href="#configuration-first-provisioning">Provisioning</a> &bull;
  <a href="#candidate-provider-matrix">Supported Backends</a> &bull;
  <a href="#upstream-compatibility-references">Upstream References</a> &bull;
  <a href="#hardware-aware-cuda-selection">CUDA</a> &bull;
  <a href="#docker-sdk-integration">Docker</a> &bull;
  <a href="#local-metadata-and-examples">Examples</a> &bull;
  <a href="#verification-and-failure-behavior">Verification</a> &bull;
  <a href="#contributing">Contributing</a> &bull;
  <a href="#license">License</a>
</p>

## Overview

**0.1.0 — configuration-first provisioning and opt-in runtime installers.** Hardware-aware local infrastructure
provisioning for supported Sinapsis workloads. The managed platform remains the
solution for incompatible or distributed workloads. No telemetry, image publishing, driver installation or model downloads are included.
Remote discovery supports a generated public catalog; publishing the catalog is a separate Hub CI task.

## Installation

Requires CPython 3.13 or later and [uv](https://docs.astral.sh/uv/) on PATH.
Docker provisioning additionally requires Docker Engine or Docker Desktop with
Linux containers and Buildx.

For a standalone infrastructure CLI:

```sh
uv tool install --python 3.13 sinapsis-infra
sinx-infra doctor
```

For runtime installation into an existing application environment, activate
that environment and install:

```sh
uv pip install sinapsis-infra
sinx-infra doctor
```

Use the second method for `install` commands that modify your application's
Python environment. An isolated `uv tool` environment is intended for managed
provisioning, not for installing bindings into another environment.

If needed, install Python with `uv python install 3.13`. No ML frameworks are
installed into the CLI environment by default. Native-only requests do not
import or connect to Docker.

## Runtime installation

The `install` command is separate from `plan`/`provision`: it modifies the
invoking Python virtual environment rather than creating an immutable managed
profile. Installing `sinapsis-infra` alone does not install inference runtimes.
For local Sinapsis llama.cpp templates, the runtime required is
`llama-cpp-python` (Python bindings), not the standalone `llama-server` executable.

Install into the **same** environment as your application, not a separate `uv tool`
environment. For example, on Linux/macOS:

```sh
uv venv --python 3.13
source .venv/bin/activate
uv pip install sinapsis-infra
sinx-infra install llama-cpp-python --dry-run
sinx-infra install llama-cpp-python --allow-source-build
uv pip install sinapsis-llama-cpp
```

On Windows PowerShell, activate the environment with `.venv\Scripts\Activate.ps1`.
Alternatively invoke the target environment's Python directly with
`python -m sinapsis_infra install llama-cpp-python`. All installation subprocesses
explicitly target that interpreter. If `sinapsis-llama-cpp` is already installed,
you can use the installer to replace its existing bindings with an accelerated build.
See the [upstream bindings installation guide](https://github.com/abetlen/llama-cpp-python#installation)
for additional platform and toolkit requirements.

| Option | Purpose |
| --- | --- |
| `--dry-run` | Detect hardware and print candidates, without downloading wheels or changing packages. |
| `--acceleration cuda` | Select NVIDIA CUDA only. |
| `--acceleration metal` | Select Apple Silicon Metal only (`apple` is equivalent). |
| `--acceleration cpu` | Select CPU only. |
| `--acceleration rocm` / `vulkan` | Experimental source build candidates; requires `--allow-source-build` or `--from-source`. |
| `--cuda-version 13.0` | Require a specific curated CUDA family; no cross-family fallback. |
| `--bindings-version 0.3.37` | Require an exact bindings version within `>=0.3.36,<0.4`. |
| `--allow-source-build` | Permit source compilation after eligible wheels fail. |
| `--from-source` | Skip wheels entirely and permit source compilation. |
| `--allow-cpu-fallback` | In auto mode, permit CPU fallback when GPU candidates fail. |
| `--require-gpu` | Reject CPU candidates even on a host with no detected accelerator. |
| `--verbose` | Print more diagnostic output. |

```sh
# GPU only, with compilation permitted
sinx-infra install llama-cpp-python --require-gpu --allow-source-build

# CUDA-specific build
sinx-infra install llama-cpp-python --acceleration cuda --allow-source-build

# CPU only
sinx-infra install llama-cpp-python --acceleration cpu --allow-source-build
```

### Binding candidate selection

- CUDA uses the same curated hardware policy as managed provisioning: prebuilt
  candidates for CUDA 13.0 and 12.4, selected according to driver and compute
  capability; source builds require a matching supported toolkit (`nvcc` on PATH).
  A CUDA 13.2-capable driver may use a CUDA 13.0 wheel, not necessarily a 13.2 wheel.
- Apple Silicon uses Metal wheels with native arm64 Python. Under Rosetta, use a
  native arm64 interpreter for Metal; an Intel Python cannot load an arm64 wheel.
- CPU uses the upstream CPU wheel index, with source builds as an opt-in alternative.
- Linux AMD ROCm and Linux/Windows Vulkan are experimental source-build candidates
  for the unmanaged installer only, not additional certified managed profiles.
  GPU detection is a hint; a compatible SDK, compiler and drivers are still required.

Wheels are discovered from upstream indexes, filtered with Python's real wheel tags
(including ABI, architecture and Linux libc compatibility), and installed by direct
URL. The known upstream v0.3.37 CUDA 13.0 Linux x86-64 and Windows x64 release URLs
are also tried if they match the requirement. Other CUDA wheel families are not
assumed supported merely because their index URLs can be constructed. Index
availability and wheel installation are determined at runtime. The installer does
not add hardware indexes to an application's universal `uv.lock`.

Source builds need a compatible C/C++ compiler, build tooling and the relevant GPU
SDK. The installer does not install OS dependencies, GPU drivers or toolkits. On
Linux, recent CUDA wheels may require glibc 2.35 or newer. Inspect `nvidia-smi`,
`nvcc --version`, `ldd --version` and `python -m platform` when troubleshooting.

### Verification and environment ownership

The installer imports the bindings in a fresh process, checks the version and GPU
offload capability, and runs `uv pip check`. This is **not** a model inference test
or proof of actual execution on a particular GPU. Verify with a small GGUF model
and inspect device/offload logs; request full model offload using `n_gpu_layers=-1`
if supported by the model and GPU memory.

```sh
python -c "import llama_cpp; print(llama_cpp.__version__); print(llama_cpp.llama_supports_gpu_offload())"
```

Installation deliberately reinstalls the bindings in place. It is not transactional:
a failed attempt can leave the last candidate installed. Use a fresh virtual
environment if recovery is needed. A later `uv sync` may overwrite the chosen wheel
with a different distribution from the lockfile. Use `uv pip install` for this
unmanaged workflow, and `uv run --no-sync` if running commands via uv.
For reproducibility, use the managed `provision` workflow instead.
The installer refuses to change detected managed profiles or system Python.

### Standalone server and future providers

Native server provisioning is independent of the Python bindings:

```sh
sinx-infra provision --backend venv --deps llama-server --no-discovery --allow-source-build --name local-llama-server
sinx-infra run --env local-llama-server -- llama-server --version
```

This uses the hash-pinned native artifact and managed profile path. It
requires a valid native release tag; use `--llama-version` to select a specific
upstream release. There is no requirement to install the Python bindings to run the
native server. Conversely, the embedded templates do not require `llama-server`.

The `install` namespace and `sinapsis_infra.runtimes` package can be extended
with additional runtime providers (e.g. Ollama or vLLM) without introducing
mandatory inference dependencies. Those providers are not implemented yet. Use `sinx-infra install --help` to list registered installers, and `sinx-infra install llama-cpp-python --help` for runtime-specific options. See [Architecture and provider development](ARCHITECTURE.md) for ownership boundaries and how to register a new installer.

## Configuration-first provisioning

`sinx-infra` is a coordination layer, not a replacement for uv, Docker, Compose,
application frameworks or the internal cloud orchestration service. Packages own
Python dependencies and extras. A project declares supported infrastructure, and
an example/variant selects published package requirements and logical services.

```sh
# From a Hub checkout, a project directory, or an explicit local source:
sinx-infra list
sinx-infra info bank-reconciliation
sinx-infra provision bank-reconciliation local --dry-run
sinx-infra provision bank-reconciliation openai
sinx-infra provision --help-all
```

An omitted variant selects the declared default (or sole variant). Bare provision
selects the sole example in the nearest project when no explicit base-profile intent
is present; `--no-discovery` retains the explicit profile workflow. Advanced options include
`--example-file`, `--example`, `--variant`, `--deps`, `--sinapsis-packages`,
`--metadata`, `--backend`, `--acceleration`, and other flags.
`--accelerator` aliases `--acceleration`. `--service-accelerator NAME=VALUE`
overrides a selected service separately. `--llama-version` overrides its release.
Default help hides advanced flags, not functionality. Use `--format=json` for machine-readable output.

See `examples/schema2/` for a miniature Hub with illustrative application and
package-example definitions using `schema_version = 2`. Example and variant
`dependencies` contain published Python requirement strings including extras.
The resolver limits these requirements to published Sinapsis names, without direct
URLs or markers. Infrastructure metadata declares supported backends and accelerators,
including extra-specific constraints; Python dependencies belong in standard project
metadata. The schema validates enabled, supported backends,
accelerators, `requires-python`, service references, entrypoint types and relative paths.
The planner defaults to native venv when allowed, and
selects Docker automatically only when venv is excluded. Hardware fallback
and source-build policies are opt-in. The default Python is 3.13; use
`--python` for a project requiring a different installed version.

Services are definitions, not unconditional installations. Only referenced services
are provisioned, using separate profiles and aliases. The CPU application
can therefore coexist with an automatically selected CUDA/Metal llama-server.
The current registered service provider is `llama-cpp`; it uses a
hash-checked native installer and API-only source builds. `provision` installs the
service binary/profile, but does not start it or download a model. Each profile is
verified and cached independently; a multi-profile operation is not yet transactional.

### Remote catalog

Generate the catalog in the Hub checkout (not in each package):

```sh
python scripts/generate_catalog.py /path/to/sinapsis-hub
```

Commit/publish the generated root `catalog.json` through Hub CI. The CLI discovers
`applications/*/pyproject.toml` and `packages/python/*/pyproject.toml` locally, with
local matches taking precedence. From elsewhere it can read the official GitHub
catalog and matching project metadata. A `--ref` explicitly selects a remote
revision; the branch/tag is resolved to a commit SHA before both files are fetched.
`--source` aliases `--example-file` for an explicit local directory or file.
The catalog generator rejects duplicate IDs; the resolver rejects ambiguous local
matches and invalid metadata rather than silently changing source. Remote discovery requires a published Hub catalog. Remote fetching is metadata
only; dependencies must be published. Remote fetching of configs/assets/source
and durable application-level manifests are deferred.

### Runtime execution boundary

`entrypoint` is validated metadata, not yet a launcher. The actual bank agent,
webapp, configs, model selection and extras are not included in this repository.
`run --env PROFILE -- COMMAND` is the supported execution path.
`run EXAMPLE [VARIANT]`, automatic service startup and readiness, project file
retrieval and URL reporting are not implemented. Dockerfile/base-extension
workflows are supported; use Compose for native project Compose integration.
Kubernetes workers and cloud orchestration remain outside this project.

## Provision and compose

```sh
sinx-infra doctor
sinx-infra provision --backend=docker --acceleration=cpu --name=base
sinx-infra provision --backend=docker --acceleration=cuda --deps=torch,trt --name=vision-base
sinx-infra provision --backend=docker --acceleration=cuda --deps=trt,torch --sinapsis-packages sinapsis-chatbots,sinapsis-easyocr --name=vision
sinx-infra provision --backend=venv --acceleration=apple --deps=torch,llama-cpp-python --allow-source-build --name=mac
sinx-infra verify vision
sinx-infra inspect vision --format=json
sinx-infra run --env vision -- python -c 'import torch; print(torch.cuda.is_available())'
```

These are supported request shapes, not guarantees that every published package
version or machine will resolve. `--backend=auto` currently selects native venv.
`--acceleration=auto` considers required capabilities, not just GPU presence.
`apple`, `metal` and `mps` select the native Apple family (providers select Metal
or MPS individually). Docker Desktop on macOS does not expose Metal. A fallback
from an unavailable GPU to CPU requires `--allow-cpu-fallback` unless the workload
explicitly supports only CPU. Explicit acceleration is never downgraded.

`plan` or `provision --dry-run` resolves and displays the plan, including locks,
without creating a target environment or building images. Resolution may query
upstream metadata and download metadata/artifacts to the uv cache. `--no-build`
requires the exact Docker image to already exist locally and disallows source
builds; resolution is still performed. `--allow-source-build` permits selected
llama.cpp source fallbacks. No arbitrary source builds are permitted. Some NVIDIA
TensorRT packaging shims are sdists and are specifically allowed as an exception.

## Candidate provider matrix

| Capability | CPU | NVIDIA CUDA | Native Apple Silicon |
|---|---|---|---|
| Empty foundation / GPU access | Yes | Driver/passthrough | Native |
| torch | CPU distribution | 2.9.0 / cu126, cu128, cu130 | MPS |
| trt | No | TensorRT 10.13.3.9.post1 / CUDA 12 or 13 | No |
| torch-trt | No | 2.9.0 / cu126, cu128, cu130, Linux only | No |
| llama-cpp-python | CPU wheel/source | cu124/cu130 wheel candidates or matching source | Metal wheel/source |
| llama-server | Upstream binary/source | Matching CUDA binary/source | Metal binary/source |
| cuda-runtime / cuda-devel | No | Selected CUDA family | No |
| onnxruntime / onnxruntime-gpu | CPU | CUDA variant | CPU only |
| ffmpeg / opencv | System dependencies | Same | Host prerequisites |

These are **candidate policies**, not a hardware-certified compatibility matrix.
CUDA targets Linux/amd64 containers and Linux/Windows amd64 native hosts;
Windows Docker uses WSL2. Native macOS supports Apple acceleration only.
Python 3.14+ is permitted if artifacts resolve; Python never falls below 3.13.
ROCm, Vulkan, vLLM, Unsloth and TensorFlow remain outside the curated policy.

## Hardware-aware CUDA selection

`--cuda-version=auto` is the default. Choose an explicit family only if needed:

```sh
sinx-infra doctor
sinx-infra plan --backend=docker --acceleration=cuda --deps=torch,trt
sinx-infra provision --backend=docker --acceleration=cuda --cuda-version=12.6 --deps=torch,trt --name=vision126
sinx-infra provision --backend=venv --acceleration=cuda --deps=llama-cpp-python,llama-server --allow-source-build --name=llama
```

The versioned local policy is `src/sinapsis_infra/hardware/cuda-policy.toml`. It defines
candidate CUDA 12.4, 12.6, 12.8 and 13.0 families and provider availability;
not every capability is offered in every family. It can be extended with
reviewed upstream artifacts, independently of the deferred remote registry.
The planner:

1. Reads the maximum driver CUDA version, device compute capabilities and the
   native `nvcc` version (if on PATH). Docker CUDA requests probe the daemon's
   actual GPU exposure rather than using the client's GPU version.
2. Filters by driver, every detected GPU architecture, required providers and
   matching native toolkit if a source build is needed.
3. Tries compatible prebuilt candidates newest first; tries explicitly allowed
   source builds after those candidates fail. uv checks Python wheel availability
   and dependency compatibility; standalone llama.cpp assets and Windows runtime
   companions must match the selected family and have SHA-256 digests.
4. Records `cuda_version` and `cuda_architectures` in the plan and fingerprint.
   All generated image, wheel, toolchain, loader and verification settings use
   the selected family. Explicit version requests do not fall back to another.

A 13.x-capable driver can select a 12.x family if the workload needs it. An
older driver will not select an unsupported newer family. Native prebuilt paths
need no nvcc; native compilation uses the matching compiler on PATH. Docker
compilation uses the selected development image, not the host toolkit.
ONNX Runtime GPU is currently limited to the CUDA 12 families in this policy.
The policy does not exploit CUDA minor-version forward compatibility, and does
not claim support for all CUDA releases or GPU generations. Automatic selection
of Docker on a remote GPU host without a local NVIDIA device is not guaranteed
for optional GPU workloads; explicitly select CUDA in that case.

A CUDA Docker plan may pull the small Python foundation and run a GPU probe even
in dry-run mode. It does not build the application image. `doctor` reports host
`driver_cuda` and `toolkit_cuda` separately. The selected version, not the host's
maximum version, is shown by `plan` and `inspect`. Full verification still
requires real GPU execution.

### Upstream compatibility references

Hardware compatibility, accelerator selection and dependency resolution
policies are informed by the following upstream documentation:

- [PyTorch — Previous Versions](https://pytorch.org/get-started/previous-versions/): CUDA and ROCm compatibility, supported versions and wheel distribution.
- [Torch-TensorRT — Releases](https://github.com/pytorch/TensorRT/releases): PyTorch, TensorRT and CUDA version compatibility.
- [NVIDIA TensorRT — Python Installation Guide](https://docs.nvidia.com/deeplearning/tensorrt/latest/installing-tensorrt/install-pip.html): Python package installation and CUDA-specific distributions.
- [llama-cpp-python — Installation and Hardware Acceleration](https://github.com/abetlen/llama-cpp-python): Supported acceleration backends, prebuilt wheels and source build requirements.
- [ONNX Runtime — CUDA Execution Provider](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html): CUDA and cuDNN compatibility requirements for GPU inference.

## Docker SDK integration

Docker Engine operations use the official Python Docker SDK: daemon inspection,
image inspection, pulling, tagging and removal, and noninteractive verification
containers (including NVIDIA device requests, network isolation, exit status,
separate stdout/stderr and cleanup). SDK sessions are closed after each operation.
The SDK uses Docker context configuration, including Docker Desktop; the transport
checks daemon identity against the CLI before delegating Buildx operations and
rejects daemon changes. Simultaneously setting `DOCKER_HOST` and `DOCKER_CONTEXT`
is rejected to avoid ambiguous daemon selection.

Buildx remains a subprocess for architecture-specific OCI manifest inspection
and builds with BuildKit cache mounts. `sinx-infra run` retains the Docker CLI
for foreground commands with inherited terminal I/O and signal handling. Docker
CLI and Buildx therefore remain prerequisites for Docker provisioning. Native
commands and uv continue using the ordinary subprocess transport. Applications
embedding the manager should inject `DockerSDKRunner` from
`sinapsis_infra.provisioning.backends.docker_sdk` rather than `SubprocessRunner` for Docker workflows.

## Reusable Docker base and optional application layer

The infrastructure and application locks are resolved together first. The base
contains only the infrastructure closure; the application image extends it with
the selected packages. Matching base fingerprints reuse locally built images.
No external Sinapsis image registry is contacted. Python and uv foundations are
pinned by architecture-specific OCI digest. Development toolchains are isolated
in build stages except when explicitly requested via `cuda-devel`. No model
weights are baked into images. BuildKit cache mounts avoid storing download caches
in the final image. The default runtime user is non-root (`sinx`, UID/GID 10001).
The venv is created and synced as that user; builder and native artifact copies
set ownership directly. There is no recursive ownership change after installing
packages, avoiding duplicate multi-gigabyte image layers. Derived images use the
same non-root installation path. Images and build caches are not deleted automatically. The non-root uv cache
uses a dedicated BuildKit cache ID.

The base contract is `/opt/sinx/venv`, `/opt/sinx/bin`, `/opt/sinx/lib`,
`/opt/sinx/requirements.lock`, `/opt/sinx/constraints.txt`,
`/opt/sinx/infrastructure.json`, plus `/app`, `/models` and `/artifacts`.
`VIRTUAL_ENV`, `PATH`, `UV_CONSTRAINT` and accelerator index options are set.
Use the recorded image tag (PowerShell: `ConvertFrom-Json`) to extend a base:

```sh
BASE=$(sinx-infra inspect vision-base --format=json | python -c 'import json,sys; print(json.load(sys.stdin)["artifact"])')
docker build --build-arg SINX_BASE_IMAGE="$BASE" -t sinx-demo examples/base-extension
docker run --rm --gpus all sinx-demo
```

In a real demo Dockerfile:

```dockerfile
ARG SINX_BASE_IMAGE
FROM ${SINX_BASE_IMAGE}
WORKDIR /app
RUN uv pip install sinapsis-easyocr && uv pip check
COPY . .
```

Exact versions and constraints protect infrastructure in conventional uv
installs, but arbitrary manual commands can bypass them. For a reproducible
application use complete provisioning and its hashed lock; a hand-written
extension is not a managed verified artifact. Debian apt packages and source
build dependency toolchains are not fully hash-pinned; the fingerprint is a
resolved-profile identity, not a bit-for-bit build reproducibility guarantee.

For native profiles, `sinx-infra run --env NAME -- python ...` sets venv and
native-library paths. Do not mutate the managed venv. For containers, the same
command starts a new ephemeral container without host mounts or published ports.
For a demo requiring models, a workspace, secrets or ports, use normal Docker
run/Compose configuration (mount models externally and bind ports to localhost).
Application execution and telemetry remain with existing Sinapsis tools.

## Local metadata and examples

Package metadata opts into infrastructure discovery using `[tool.sinapsis.infra]`.
Python dependencies and extras are declared in standard project metadata. The following
example uses the schema 2 package definition in `examples/schema2/`:

```toml
[project]
name = "sinapsis-chatbots"
version = "1.0.0"
requires-python = ">=3.13"

[project.optional-dependencies]
torch = ["torch>=2"]

[tool.sinapsis.infra]
schema_version = 2
enabled = true
backends = ["docker", "venv"]
accelerators = ["cpu", "cuda", "metal"]

[tool.sinapsis.examples.chatbot]
default_variant = "openai"
description = "Chatbot package features"

[tool.sinapsis.examples.chatbot.variants.openai]
dependencies = ["sinapsis-chatbots", "sinapsis-openai"]
acceleration = "cpu"

[tool.sinapsis.examples.chatbot.variants.torch]
dependencies = ["sinapsis-chatbots[torch]"]
acceleration = "auto"
```

`enabled` defaults to false; accelerator-independent packages use `["any"]`.
Extra-specific accelerator and backend constraints may be declared under
`[tool.sinapsis.infra.extras.NAME]`. The metadata must describe the exact released
version. Local declarations are read without importing packages; pass repeatable
`--metadata PATH` arguments. Known transitive package declarations and recognised
Python dependencies are considered during resolution. Packages without metadata
are not certified: explicit `--deps` or `--no-discovery` allows a manual request
with a warning; package-only automatic discovery requires local declarations.
The provisioner cannot discover arbitrary tool metadata from PyPI.

```sh
sinx-infra metadata examples/schema2/packages/python/sinapsis-chatbots/pyproject.toml
sinx-infra examples examples/schema2/packages/python/sinapsis-chatbots/pyproject.toml
```

Explicit `--deps` are additive. `--base-only` uses the application requirements
to resolve a compatible infrastructure image but does not install application
packages. Repeated package arguments support extras and version constraints.

The schema 2 bank reconciliation directory contains **illustrative** local and
OpenAI infrastructure variants. It does not include the actual demo Agent,
sample data or unpublished application sources. Check and adapt the package list,
extras, service release and paths to the real demo before using it.

```sh
sinx-infra examples examples/schema2/applications/bank-reconciliation/pyproject.toml
sinx-infra provision --backend=docker --example-file examples/schema2/applications/bank-reconciliation/pyproject.toml --example bank-reconciliation --variant=openai --name=bank-openai
sinx-infra provision --backend=docker --example-file examples/schema2/applications/bank-reconciliation/pyproject.toml --example bank-reconciliation --variant=local --allow-source-build --dry-run
```

If the published bank package unconditionally depends on llama.cpp, the OpenAI
variant cannot remove it merely by changing this example declaration. Make the
provider dependency optional upstream first.

## Verification and failure behavior

Provisioning checks the exact locked package versions and `uv pip check`, Python
version/architecture and relevant capability probes before registering a ready
profile. CUDA driver verification performs an actual device memory transfer;
Torch performs matrix multiplication on the selected device; TensorRT builds and
runs a tiny engine. Torch-TensorRT, ONNX and llama.cpp bindings have import/device
capability checks, and standalone llama-server has executable/device-list checks.
These last checks do not substitute for model-level inference testing. No model
is downloaded. Unsupported combinations fail rather than split workloads across
containers or silently change explicit requirements.

Local state uses schema 3. Use `--root` to select a separate state directory. Failed
provisioning does not register a ready alias; a state directory lock serializes
mutations. If a process is killed, inspect stale locks/unregistered directories
before removing them manually. There is no automatic prune/remove command.

## Contributing

Contributions are welcome. See the [Contributing Guide](CONTRIBUTING.md)
for the project architecture, development setup, testing instructions,
and guidance on adding new runtime providers and provisioning backends.

## License

Sinapsis Infra is available under your choice of the [MIT License](LICENSE-MIT)
or the [Apache License 2.0](LICENSE-APACHE).

Third-party runtimes, Python packages, native binaries, container images and
other artifacts downloaded or installed by Sinapsis Infra are subject to their
respective licenses and terms. The license of Sinapsis Infra does not override
those terms. No third-party runtime binaries or ML packages are bundled in the
Sinapsis Infra distribution.