Add Local RAT Support 🧠🐀 #2
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing local RAT (Retrieval Augmented Thinking) enabling users to leverage locally hosted API endpoints for reasoning and response generation.
The implementation uses LM Studio for hosting local OpenAI-compatible large language models (LLMs) and has been tested to work seamlessly.
Changes
New Script:
rat-local.py:ModelChainclass to integrate local DeepSeek and response clients.get_deepseek_reasoning) and response generation (get_local_response) capabilities using locally hosted models.Updated
.envConfiguration:LOCAL_API_KEYfor authentication with the local API..envfor user reference.Model Constants:
rat-local.py:Key Features
LOCAL_API_KEYandhttp://localhost:1234/v1.<think>tags for enhanced interpretability.How to Test
http://localhost:1234/v1..envFile:(for LM Studio you can set it to "lmstudio")
model <name>Command: Switch between response models dynamically.reasoningCommand: Toggle reasoning process visibility.clearCommand: Clear the chat history.Example