Skip to main content

RAG-demo

Chat with (a small portion of) Wikipedia

⚠️ RAG functionality is still under development. ⚠️

app screenshot

Requirements

  1. The uv Python package manager
    • Installing and updating uv is easy by following the docs.
    • As of 2026-01-25, I'm developing using uv version 0.9.26, and using the new experimental --pytorch-backend option.
  2. A terminal emulator or web browser

Notes on terminal emulators

Certain terminal emulators will not work with some features of this program. In particular, on macOS consider using iTerm2 instead of the default Terminal.app (explanation). On Linux you might want to try kitty, wezterm, alacritty, or ghostty, instead of the terminal that came with your desktop environment (reason). Windows Terminal should be fine as far as I know.

Optional dependencies

  1. Hugging Face login
  2. API key for your favorite LLM provider (support coming soon)
  3. Ollama installed on your system if you have a GPU
  4. Run RAG-demo on a more capable (bigger GPU) machine over SSH if you can. It is a terminal app after all.
  5. A C compiler if you want to build Llama.cpp from source.

Run the latest version

Run in a terminal:

uvx --python=3.12 --torch-backend=auto --from=jehoctor-rag-demo@latest chat

Or run in a web browser:

uvx --python=3.12 --torch-backend=auto --from=jehoctor-rag-demo@latest textual serve chat

CUDA acceleration via Llama.cpp

If you have an NVIDIA GPU with CUDA and build tools installed, you might be able to get CUDA acceleration without installing Ollama.

CMAKE_ARGS="-DGGML_CUDA=on" uv run --extra=llamacpp chat

Metal acceleration via Llama.cpp (on Apple Silicon)

On an Apple Silicon machine, make sure uv runs an ARM interpreter as this should cause it to install Llama.cpp with Metal support. Also, run with the extra group llamacpp. Try this:

uvx --python-platform=aarch64-apple-darwin --torch-backend=auto --from='jehoctor-rag-demo[llamacpp]@latest' chat

Ollama on Linux

Remember that you have to keep Ollama up-to-date manually on Linux. A recent version of Ollama (v0.11.10 or later) is required to run the embedding model we use. See this FAQ: https://docs.ollama.com/faq#how-can-i-upgrade-ollama.

Project feature roadmap

  • ❌ RAG functionality
  • ✅ torch inference via the Langchain local Hugging Face inference integration
  • ✅ uv automatic torch backend selection (see the docs)
  • ❌ OpenAI integration
  • ❌ Anthropic integration

Run from the repository

First, clone this repository. Then, run one of the options below.

Run in a terminal:

uv run chat

Or run in a web browser:

uv run textual serve chat

Release files for jehoctor-rag-demo 0.2.5

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

Source distribution (sdist)

Source distribution for jehoctor-rag-demo 0.2.5
File Size Uploaded
jehoctor_rag_demo-0.2.5.tar.gz 20.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jehoctor-rag-demo 0.2.5
File Interpreter ABI Platform
jehoctor_rag_demo-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 49.6 kB

Release files / jehoctor_rag_demo-0.2.5.tar.gz

Download URL jehoctor_rag_demo-0.2.5.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
26ad5785413fa5c3af2d1841d91f7f6864bb73f130c718f5d6bff0516aa8c247
BLAKE2b-256 checksum
How to use checksums
119d86089eca6662d6b8dc28376c5296deea1b3a42bd16a23d5a6b91df2a0eed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / jehoctor_rag_demo-0.2.5-py3-none-any.whl

Download URL jehoctor_rag_demo-0.2.5-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07eb01506bdbd0399c395e1c09aed3921439b2d37519130a4280d759e9527b00
BLAKE2b-256 checksum
How to use checksums
e31ff6264ea8b2c6c79b0688d473874fe1c3ffcf52323c83d23377b8567e1290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

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