Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DEEPSEEK_API_KEY=your_deepseek_api_key_here
OPENROUTER_API_KEY=your_openrouter_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ This approach ensures more thoughtful, contextually aware, and reliable response
- 🧠 **Reasoning Visibility**: Toggle visibility of the AI's thinking
- 🔄 **Context Awareness**: Maintains conversation context for more coherent interactions

## 🖥️ Streamlit Interface

The new Streamlit interface offers a modern, user-friendly way to interact with RAT:

- 💻 **Web-Based UI**: Clean, intuitive interface with dark theme support
- 🔄 **Live Streaming**: Watch reasoning and responses being generated in real-time
- 🤖 **Advanced Model Management**:
- Manually enter models with automatic provider prefix detection
- Fetch top weekly models directly from OpenRouter (may take 1-2 minutes)
- Select models from a dropdown menu of popular options
- 📊 **Token Tracking**: Transparent display of token usage for each response:
- Input tokens (question)
- Reasoning tokens (thinking process)
- Response tokens (final answer)
- Total tokens consumed
- 🧠 **Reasoning Toggles**: Show or hide the detailed reasoning process for each response
- 📜 **Conversation History**: Full chat history with metadata for each interaction
- ⚙️ **Customizable Settings**: Adjust interface preferences via sidebar controls

## ⚙️ Requirements

• Python 3.11 or higher
Expand Down Expand Up @@ -73,6 +92,17 @@ This will install RAT as a command-line tool, allowing you to run it from anywhe
- Type "reasoning" to show/hide the thinking process
- Type "quit" to exit

4. Launch the Streamlit interface:
```bash
streamlit run rat/ui.py
```

5. Using the Streamlit interface:
- Ask questions in the chat input at the bottom
- View detailed token usage for each response
- Toggle reasoning visibility in the sidebar
- Change models manually or select from top weekly models
- Clear chat history as needed


## 🚀 Versions
Expand All @@ -92,6 +122,13 @@ Run it using:
uv run rat-claude.py
```

### Streamlit Interface (ui.py)
A modern web-based interface with real-time streaming, token tracking, and model selection.
Run it using:
```bash
streamlit run rat/ui.py
```


## 🤝 Contributing

Expand All @@ -116,5 +153,4 @@ GitHub: https://github.com/yourusername/rat

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=Doriandarko/RAT-retrieval-augmented-thinking&type=Date)](https://star-history.com/#Doriandarko/RAT-retrieval-augmented-thinking&Date)

[![Star History Chart](https://api.star-history.com/svg?repos=Doriandarko/RAT-retrieval-augmented-thinking&type=Date)](https://star-history.com/#Doriandarko/RAT-retrieval-augmented-thinking&Date)
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ dependencies = [
"pyperclip>=1.9.0",
"python-dotenv>=1.0.1",
"rich>=13.9.4",
"selenium>=4.30.0",
"streamlit>=1.44.0",
"tiktoken>=0.9.0",
]

[project.scripts]
Expand Down
2 changes: 1 addition & 1 deletion rat-claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def main():
continue

reasoning = chain.get_deepseek_reasoning(user_input)
claude_response = chain.get_claude_response(user_input, reasoning)
claude_response = chain.get_claude_response(user_input, reasoning) # noqa: F841

except KeyboardInterrupt:
continue
Expand Down
Loading