ReACT / README.md
HAMMALE's picture
Initial ReAct Space: Compare Think-Only, Act-Only, and ReAct reasoning modes
35bd451
---
title: ReAct - Reasoning Modes Comparison
emoji: ๐Ÿง 
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
---
# ๐Ÿง  LLM Reasoning Modes Comparison
This Space demonstrates and compares three different reasoning paradigms for Large Language Models using **openai/gpt-oss-20b**:
## ๐ŸŽฏ Reasoning Modes
### 1. **Think-Only** (Chain-of-Thought)
- Uses internal reasoning and knowledge only
- Shows step-by-step thought process
- No external tool access
- Best for: Problems solvable with general knowledge
### 2. **Act-Only** (Tool Use)
- Uses external tools to gather information
- Shows actions and observations only
- Minimal explicit reasoning
- Best for: Fact-checking and real-time data retrieval
### 3. **ReAct** (Reasoning + Acting)
- Interleaves Thought โ†’ Action โ†’ Observation
- Combines reasoning with tool use
- Most comprehensive approach
- Best for: Complex problems requiring both reasoning and external data
## ๐Ÿ› ๏ธ Available Tools
The agent has access to these real external tools:
- **๐Ÿ” DuckDuckGo Search**: Web search for current information
- **๐Ÿ“š Wikipedia Search**: Detailed encyclopedic knowledge
- **๐ŸŒค๏ธ Weather API**: Real-time weather data for any location
- **๐Ÿงฎ Calculator**: Safe mathematical expression evaluation
- **๐Ÿ Python REPL**: Execute Python code for data processing
## ๐Ÿš€ How to Use
1. Enter your question in the text box
2. Select a reasoning mode (or "All" to compare)
3. Click "Run" to see the agent work in real-time
4. Watch as thoughts, actions, and observations unfold
## ๐Ÿ“ Example Questions
- "What is the capital of France and what's the current weather there?"
- "Who wrote 'To Kill a Mockingbird' and when was it published?"
- "Calculate the compound interest on $1000 at 5% annual rate for 3 years"
- "What is the population of Tokyo and how does it compare to New York City?"
## ๐Ÿ”ง Setup
To run this Space, you need to set your Hugging Face token:
1. Go to Space Settings โ†’ Repository Secrets
2. Add a secret named `HF_TOKEN` with your Hugging Face API token
3. The Space will automatically use this token to access the model
## ๐Ÿ“š Technical Details
- **Model**: openai/gpt-oss-20b (via Hugging Face Inference API)
- **Framework**: Gradio for the UI
- **Agent Format**: Inspired by smolagents/ReAct paradigm
- **Streaming**: Real-time display of intermediate steps
## ๐ŸŽ“ Learn More
This implementation demonstrates the ReAct (Reason + Act) paradigm described in:
- Yao et al. (2022) "ReAct: Synergizing Reasoning and Acting in Language Models"
The three modes show how different combinations of reasoning and tool use affect problem-solving capabilities.
## ๐Ÿ“„ License
MIT License - feel free to use and modify!