Skip to main content

Multi-threaded Reasoning for Large Language Models

Project description

RiCA: Multi-threaded Reasoning for Large Language Models

English 中文

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.

Documentation

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.dev3.tar.gz (30.4 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.dev3-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rica_server-0.0.1.dev3.tar.gz
  • Upload date:
  • Size: 30.4 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.dev3.tar.gz
Algorithm Hash digest
SHA256 d8f673272a2a6e075fa0983c5d1ae2928936bc72d7f39b52d23d27b00c2ea005
MD5 169a7f1c8e7c31e3e3e3dd0b7d032999
BLAKE2b-256 d640802310cb6e3f29da74ebf9908635518c497e56a29c748ddc208f418be6d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rica_server-0.0.1.dev3.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.dev3-py3-none-any.whl.

File metadata

File hashes

Hashes for rica_server-0.0.1.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 b62ea4ae6d7f7575142012f6e893335e166900b129bb47f354c3d36b235ad75e
MD5 79845026ee0002c4911dcc09f741b2f5
BLAKE2b-256 156343d49b964d7b123b8a265cf5519b9d279e7527481b6c9d03e2de33295750

See more details on using hashes here.

Provenance

The following attestation bundles were made for rica_server-0.0.1.dev3-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