Skip to main content

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.5.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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for riley-ai 0.6.0
File Size Uploaded Provenance
riley_ai-0.6.0.tar.gz 44.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for riley-ai 0.6.0
File Interpreter ABI Platform
riley_ai-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 95.7 kB

Release files / riley_ai-0.6.0.tar.gz

Download URL riley_ai-0.6.0.tar.gz
Size 44.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3e42e8a0377d1b65fb6f3ec39a73f56fd651346925ee0648bafd162e6a7f08d6
BLAKE2b-256 checksum
How to use checksums
6116fd58b163ad039d8dc31b704bb43ea1d4a5139488bfb888287c7f1ca5e375
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.0-py3-none-any.whl

Download URL riley_ai-0.6.0-py3-none-any.whl
Size 50.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba68cdb3d455aea49bea2f0c0a907c40eec91c0a6a7625ab54371db5d7e63c4b
BLAKE2b-256 checksum
How to use checksums
1879dcd46288e0db3d26af0e6565cfa8176aae9fda6f9427fcc2a69a898368fb
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.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page