Metadata-Version: 2.4
Name: riley-ai
Version: 0.7.0
Summary: Chat assistant with explicit local and hosted model providers.
License: GPL-3.0-only
Keywords: ai,gemini,ollama,openai,anthropic,huggingface,cli
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Education
Classifier: Topic :: Education
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Framework :: Pydantic :: 2
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anyio>=4.0.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: filelock>=3.0.0
Requires-Dist: google-genai>=1.73.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: ollama>=0.6.1
Requires-Dist: python-dotenv>=1.2.2
Requires-Dist: sympy>=1.14.0
Requires-Dist: uvicorn>=0.30.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: keyring>=25.0.0
Requires-Dist: rich>=15.0.0
Provides-Extra: web
Requires-Dist: requests>=2.33.1; extra == "web"
Requires-Dist: sentence-transformers>=5.4.1; extra == "web"
Requires-Dist: trafilatura>=2.0.0; extra == "web"
Dynamic: license-file

# Riley-AI

[![PyPI version](https://img.shields.io/pypi/v/riley-ai)](https://pypi.org/project/riley-ai/)
[![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue?logo=python)](https://pypi.org/project/riley-ai/)
[![License: GPL-3.0-only](https://img.shields.io/badge/license-GPL--3.0--only-blue)](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/LICENSE)

Current source version: **0.7.0**.

A Python assistant with browser chat, a terminal client, and an HTTP API. Choose
local Ollama inference or Google's Gemini API. Each browser/API session owns its
conversation and settings; CLI history and configuration are stored separately.

## Model choices

Use local Ollama or downloaded Hugging Face GGUF models, or explicitly select
Google Gemini, Anthropic Claude, OpenAI, or Hugging Face hosted inference.
Credentials are scoped to the selected provider; failures never select a
replacement service. See [model providers](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/docs/PROVIDERS.md) for setup and
supported controls. Hosted services receive the prompts and context you send.

## Quick start

Install Python 3.12+, [uv](https://docs.astral.sh/uv/), and a model provider.
From a source checkout:

```sh
git clone https://codeberg.org/ChocolatePastry/riley-ai.git
cd riley-ai
uv sync --locked
uv run riley --provider ollama --model YOUR_LOCAL_MODEL
```

Install the model in Ollama before launching. Open `http://127.0.0.1:8000` for
browser chat, or add `--cli` for terminal chat. Use `GOOGLE_API_KEY` and
`--provider google --model YOUR_GEMINI_MODEL` for Gemini. Credentials can be
provided without a working keyring. The server does not prompt for a key.

## Sessions and streaming

Answers and provider-supplied reasoning are separate fields. Session settings
include model selection, generation controls, and reasoning visibility. The API
requires a bearer session or browser cookie; create a session before calling
chat endpoints. An incomplete or cancelled turn is rolled back.

Model I/O is asynchronous. Each session admits one operation at a time, and the
server separately bounds generations and blocking tools. Use one server worker;
sessions are in memory and reset on restart. Run locally for trusted users and
review the API's deployment limits before choosing a network bind address.

The calculator and web-search pipeline run through bounded tool workers. Web
search contacts external sites and requires a cached embedding model. Tool output
may be sent to the selected model provider. Local Ollama inference does not make
web requests anonymous.

Web search is disabled by default. To enable it, install the optional dependencies
with `uv sync --locked --extra web`, cache the embedding model locally, and set
`RILEY_WEB_ENABLED=1 RILEY_SEARCH_BACKEND=searxng` before launch.
Start the local SearXNG service separately; Riley does not install or start it.
Enabled searches contact the engines configured in SearXNG and result sites.


## Documentation

| Guide | Purpose |
| --- | --- |
| [Setup and chat usage](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/docs/SETUP.md) | Install, select a provider, use terminal commands, and locate local data. |
| [HTTP API](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/docs/API.md) | Create sessions, stream replies, and update settings. |
| [Architecture](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/docs/ARCHITECTURE.md) | Understand ownership, concurrency, and provider boundaries. |
| [Testing](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/docs/TESTING.md) | Run deterministic checks and understand their limits. |
| [Contributing](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/CONTRIBUTING.md) | Prepare a focused code or documentation change. |

## License

[GPL-3.0-only](https://codeberg.org/ChocolatePastry/riley-ai/src/branch/main/LICENSE).
