Skip to main content

Multi-threaded Reasoning for Large Language Models

Project description

RiCA: Multi-threaded Reasoning for Large Language Models

Run in Colab

RiCA is a framework that enables Large Language Models (LLMs) to perform multi-threaded reasoning. It allows LLMs to call external tools, continue thinking while waiting for the results, and handle multiple tool calls concurrently.

Key Features

  • Multi-threaded Reasoning: LLMs can execute long-running tasks in the background without blocking their thought process.
  • Tool Integration: Easily integrate external tools and APIs through a simple decorator-based routing system.
  • Real-time Interaction: Observe the model's "thinking" process in real-time through token-by-token streaming.
  • Flexible and Extensible: Designed to be adapter-based, allowing for easy integration with different LLM backends (e.g., Transformers, OpenAI).

Getting Started

Installation

You can install RiCA and its dependencies using pip:

pip install .[pt]

Running the Demo

The demo/example.py script provides a simple example of how to use RiCA. To run it, first make sure you have the necessary dependencies installed, then run the following command from the project root:

PYTHONPATH=. python demo/example.py

You can also explore the demo.ipynb notebook for a more interactive experience.

How it Works

RiCA works by introducing a "multi-threaded thinking" capability to LLMs. When an LLM needs to use an external tool, it can choose to run it in the background. While the tool is running, the LLM can continue to reason, process information, and even call other tools. When a background tool finishes, its result is seamlessly inserted back into the LLM's context, allowing it to incorporate the new information into its reasoning process.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rica_server-0.0.1.dev2.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rica_server-0.0.1.dev2-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file rica_server-0.0.1.dev2.tar.gz.

File metadata

  • Download URL: rica_server-0.0.1.dev2.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rica_server-0.0.1.dev2.tar.gz
Algorithm Hash digest
SHA256 7382ab2d124651c8e50fc74dc380a2f008f92de4d152d0476a602f9e9558e518
MD5 78e2e49c23b75c9dc6406ac4a33d2f41
BLAKE2b-256 4f75aea4c795a2d3117d6506bda205246dfd48212364ce65841222075b944342

See more details on using hashes here.

Provenance

The following attestation bundles were made for rica_server-0.0.1.dev2.tar.gz:

Publisher: pypi.yml on rica-team/rica-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rica_server-0.0.1.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for rica_server-0.0.1.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ca71b980f39c34840eff43d0a7553bfcdeccf935ffc5fc61f73881501daa1ff
MD5 6e031cad4c02a35b6b864516290160d8
BLAKE2b-256 db16fbfa03b74a641756fdc79826f8a793faccc9eb467932e375511d77a2e4d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rica_server-0.0.1.dev2-py3-none-any.whl:

Publisher: pypi.yml on rica-team/rica-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page