Metadata-Version: 2.4
Name: ai-synapse
Version: 1.0.1
Summary: Free multi-provider AI SDK with terminal TUI, OpenAI-compatible API, and 27+ provider routing
Author: AI Engine Contributors
License: MIT
Project-URL: Homepage, https://github.com/mihir0209/AI_engine
Project-URL: Documentation, https://github.com/mihir0209/AI_engine/tree/main/docs
Project-URL: Repository, https://github.com/mihir0209/AI_engine
Project-URL: Issues, https://github.com/mihir0209/AI_engine/issues
Keywords: ai,llm,openai,anthropic,inference,free-ai,groq,gemini,sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: python-dotenv>=0.19.0
Requires-Dist: pydantic>=2.5.0
Provides-Extra: server
Requires-Dist: aiohttp>=3.8.0; extra == "server"
Requires-Dist: fastapi<0.116.0,>=0.104.0; extra == "server"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "server"
Requires-Dist: starlette<0.37.0,>=0.36.0; extra == "server"
Requires-Dist: jinja2<3.2.0,>=3.1.0; extra == "server"
Requires-Dist: python-multipart>=0.0.6; extra == "server"
Requires-Dist: aiofiles>=23.0.0; extra == "server"
Requires-Dist: prometheus-client>=0.17.0; extra == "server"
Requires-Dist: slowapi>=0.1.0; extra == "server"
Provides-Extra: tui
Requires-Dist: textual>=1.0.0; extra == "tui"
Requires-Dist: rapidfuzz>=3.0.0; extra == "tui"
Requires-Dist: pillow>=10.0.0; extra == "tui"
Requires-Dist: rich-pixels>=3.0.0; extra == "tui"
Provides-Extra: all
Requires-Dist: ai-synapse[server]; extra == "all"
Requires-Dist: ai-synapse[tui]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.20.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: openai>=2.0.0; extra == "dev"
Dynamic: license-file

# AI Synapse

[![PyPI](https://img.shields.io/pypi/v/ai-synapse)](https://pypi.org/project/ai-synapse/)
[![Python](https://img.shields.io/pypi/pyversions/ai-synapse)](https://pypi.org/project/ai-synapse/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)

**Free multi-provider AI SDK** with a terminal chat UI, drop-in OpenAI client, and optional local server. Routes across 27+ providers with failover, model caching, and intent-aware routing.

```bash
pip install ai-synapse[tui]    # recommended — SDK + terminal chat
python -m ai_engine tui
```

```bash
pip install ai-synapse         # SDK only
pip install ai-synapse[all]      # SDK + TUI + server extras
```

---

## Terminal chat

![Main chat](docs/images/tui_1_main_chat.png)

Sidebar history, model/provider routing, slash commands, `@` file attach, and collapsible sidebar. Full walkthrough, shortcuts, and all screenshots: **[docs/TUI.md](docs/TUI.md)**.

### Vision (image attach → describe)

![Image reply](docs/images/tui_4_image_reply.png)

Attach an image above the composer, ask a question, and get a vision-capable reply. Sent messages keep a **path reference** only — the pixel preview stays in the attachment strip until you send.

---

## Python SDK

```python
from ai_engine import OpenAI

client = OpenAI()
response = client.chat.completions.create(
    model="default",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
```

```bash
ai-engine chat "Explain quantum tunneling"
ai-engine providers
ai-engine version
```

---

## Local server (optional)

```bash
cp .env.example .env
pip install ai-synapse[server]
python -m ai_engine serve
```

OpenAI-compatible API at `http://localhost:8000/v1/` · Swagger at `/docs`.

---

## Documentation

| Doc | Contents |
|-----|----------|
| [TUI guide](docs/TUI.md) | Screenshots, shortcuts, attachments, defaults |
| [API reference](docs/API.md) | HTTP endpoints |
| [User guide](docs/USER_GUIDE.md) | Web dashboard & chat UI |
| [Provider keys](docs/collect_api.md) | Free-tier signup |
| [Deployment](docs/DEPLOYMENT.md) | Docker, production |

---

## Development

```bash
git clone https://github.com/mihir0209/AI_engine.git
cd AI_engine
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,all]"
pytest tests/
```

---

## License

MIT — see [LICENSE](LICENSE).
