Metadata-Version: 2.4
Name: pysaif
Version: 0.1.0
Summary: A local-first library that handles AI provider logistics so you don't have to.
License: MIT License
        
        Copyright (c) 2026 Ahqrk
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: tomli>=2.0; python_version < "3.11"
Requires-Dist: tomli-w>=1.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Dynamic: license-file

# pysaif

A local-first library that handles AI provider logistics — API calls, config,
memory, quota — so you don't have to think about them every time.

```python
from pysaif import AI

ai = AI()
response = ai.send("Hello!")
print(response)
```

## Install

```bash
pip install pysaif
```

## Setup

On first run, pysaif creates a `Config/` folder next to your project with
`config.toml` (API keys, model, personality — the stuff you'll actually
touch) and `advanced_config.toml` (timeouts, retries, per-model metadata —
the stuff most people never open). Drop your API key into `config.toml` and
you're done.

Each project gets its own config and its own key — pysaif never shares keys
or settings across projects, and never reads them from your environment
implicitly.

## What's implemented right now

- Config: self-healing setup, two-file split, schema versioning and migration hook
- Providers: Google Gemini, OpenAI, Anthropic Claude, OpenRouter (sync and async)
- Provider selection: `manual`, `cheapest`, `fastest`, and `smart` strategies
- Quota-aware daily token limits and automatic provider failover with retries
- Local memory under `Memory/` (rolling window, important, interests) with inject/store toggles
- Usage tracking under `Usage/` (state + optional JSONL logs; message content off by default)
- In-memory response cache (opt-in via `cache.enabled`)
- Prompt assembly from optional context, background, personality, and instructions

## Configuration highlights

`Config/config.toml`:

- `provider.strategy` — `manual` | `cheapest` | `fastest` | `smart`
- `provider.fallback_order` — provider names to try on errors
- `memory.store` / `memory.inject` — persist conversation vs. feed it into prompts
- `quota.daily_token_limit` — `0` means unlimited

## What's designed but not built yet

Interactive setup wizard, richer capability tools (search/look/make), and
automated config migrations beyond schema backfill — see the module skeleton
under `pysaif/capabilities/` for planned expansion points.

## License

See LICENSE.
