Riley AI
One conversation. Three interfaces. Your machine.
Riley connects a local Ollama model or Google Gemini to two practical tools: web research and symbolic math. It keeps one conversation on your machine, streams replies, and lets you choose the interface that fits your workflow.
Get started · Explore the interfaces · Read the docs
At a glance
| Riley gives you | |
|---|---|
| Your model | Local Ollama by default; Gemini when you add a key to your system keyring |
| Your interface | A browser chat, a Rich terminal chat, and a FastAPI HTTP API |
| Your tools | SymPy calculations and a search → scrape → rank web pipeline |
| Your history | One saved conversation shared by all three interfaces |
Riley is designed for one person running one instance. The API and CLI cannot run at the same time against the same local configuration.
Start in three steps
1. Get the current source. Python 3.12 or newer and uv are required.
git clone https://codeberg.org/ChocolatePastry/riley-ai.git
cd riley-ai
uv sync
This checkout contains the browser and API described here. The published PyPI 0.6.1 release predates those changes; see setup before installing from PyPI.
2. Prepare a model. For local chat, install Ollama, start its service, and pull Riley's default model:
ollama pull qwen3.5:9b
Want Gemini instead? Get a key and add it through uv run riley --cli. The setup guide walks through it.
3. Start chatting.
uv run riley
Open http://127.0.0.1:8000/ for the browser chat. Without a stored Gemini key, Riley uses Ollama. The API starts without asking for input.
Try it: Ask a normal question, enter
/calculate 2+2, or use/web_search Python 3.14 release notes. Tool-backed answers depend on your model and available network access.
Three ways to chat
| Interface | Launch | Best for |
|---|---|---|
| Browser | uv run riley → local chat |
A visual chat with streamed replies and saved history |
| Terminal | uv run riley --cli |
Keyboard-first chat, token counts, and tool notices |
| HTTP API | uv run riley → POST /chat |
Scripts and local integrations |
The server listens on 127.0.0.1:8000 by default. Set its bind address with --host and --port; for example, uv run riley --host 127.0.0.1 --port 8080.
A minimal API request:
curl -X POST http://127.0.0.1:8000/chat \
-H 'Content-Type: application/json' \
-d '{"message":"Explain recursion simply"}'
The reply is JSON with a response field. See commands and API for streaming, history, every CLI command, and exact request shapes.
How a message moves
flowchart TD
Entry["riley · main.py"] --> CLI["CLI"]
Entry --> API["FastAPI + browser"]
CLI --> Controller["Shared controller"]
API --> Controller
Controller --> Provider["Ollama or Gemini"]
Controller --> Tools["Math or web search"]
Controller --> History["Local chat history"]
main.py chooses the interface. Both interfaces call the same controller, which selects a provider, runs tools when needed, and saves the conversation. The architecture guide follows a request through the actual files.
Built for self-hosting
- Local by default. No Gemini key means Riley selects the configured Ollama model. Web search still fetches pages from the network.
- One conversation. History lives on disk and is shared between browser, CLI, and API. Riley trims older messages as the context grows.
- One active instance. A file lock keeps two Riley processes from using the same configuration at once.
- Local API. The server binds to localhost by default and has no built-in authentication. Add access controls before exposing it beyond your machine.
The setup guide explains prerequisites, local files, optional SearXNG, and common startup problems.
Documentation
| Guide | Start here when you want to… |
|---|---|
| Setup & prerequisites | Install Riley, Ollama, or Gemini and prepare web search |
| Commands & API | Find a CLI command, launch flag, or HTTP route |
| Architecture | Understand the controller, providers, tools, and history |
Each guide owns the detailed instructions for its topic; this README is the guided tour.
Develop Riley
From the source checkout used above, run the tests:
uv run python -m unittest discover -s tests -p 'test_*.py'
The separate scraper benchmark fetches live pages and is intentionally outside that test command. See the architecture guide for the main extension points.
License
Riley is licensed under the GNU General Public License v3.
Metadata
Release files for riley-ai 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| riley_ai-0.6.1.tar.gz | 50.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| riley_ai-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 109.0 kB
Release files / riley_ai-0.6.1.tar.gz
| Download URL | riley_ai-0.6.1.tar.gz |
|---|---|
| Size | 50.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a79e0cd5aa45b5cb5bd86a375a809536f7d18940b3949411b7f4d9890a37d0c1
|
|
BLAKE2b-256 checksum How to use checksums |
4ff02687ae2535a5ec61b3402b0086e320a1c8b69316e0a2e4a59ea1afdd9532
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / riley_ai-0.6.1-py3-none-any.whl
| Download URL | riley_ai-0.6.1-py3-none-any.whl |
|---|---|
| Size | 58.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab5ee7dbe0a2f00a058018c7d3e392df203e8239485c2760a408557c937ef549
|
|
BLAKE2b-256 checksum How to use checksums |
31cd109dff2d04fbf2d6a678ae0e401f96d1d09ec12eac3841abfecce4e10969
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for riley-ai 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.