From 8da3d2b3f89113f94405b101332dedff534b96c6 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Sun, 13 Apr 2025 20:57:39 +0200 Subject: [PATCH 1/2] refactor : test code in llmprovider --- sources/llm_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/llm_provider.py b/sources/llm_provider.py index 19b4719..7aaf099 100644 --- a/sources/llm_provider.py +++ b/sources/llm_provider.py @@ -332,6 +332,6 @@ class Provider: return thought if __name__ == "__main__": - provider = Provider("server", "deepseek-r1:32b", " 172.81.127.6:8080") + provider = Provider("server", "deepseek-r1:32b", " x.x.x.x:8080") res = provider.respond(["user", "Hello, how are you?"]) print("Response:", res) From 454e68033c98191c77276598222ff93a93ddf871 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Mon, 14 Apr 2025 11:58:02 +0200 Subject: [PATCH 2/2] Fix : prevent asking for clarification multiple time + readme update --- README.md | 13 ++++++++----- sources/agents/browser_agent.py | 2 +- sources/router.py | 5 ++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6755406..110635e 100644 --- a/README.md +++ b/README.md @@ -321,7 +321,7 @@ Example config: [MAIN] is_local = True provider_name = ollama -provider_model = deepseek-r1:1.5b +provider_model = deepseek-r1:32b provider_server_address = 127.0.0.1:11434 agent_name = Friday recover_last_session = False @@ -339,7 +339,7 @@ stealth_mode = False - is_local -> Runs the agent locally (True) or on a remote server (False). - provider_name -> The provider to use (one of: `ollama`, `server`, `lm-studio`, `deepseek-api`) -- provider_model -> The model used, e.g., deepseek-r1:1.5b. +- provider_model -> The model used, e.g., deepseek-r1:32b. - provider_server_address -> Server address, e.g., 127.0.0.1:11434 for local. Set to anything for non-local API. - agent_name -> Name of the agent, e.g., Friday. Used as a trigger word for TTS. - recover_last_session -> Restarts from last session (True) or not (False). @@ -410,9 +410,12 @@ If this section is incomplete please raise an issue. **Q: What hardware do I need?** -7B Model: GPU with 8GB VRAM. -14B Model: 12GB GPU (e.g., RTX 3060). -32B Model: 24GB+ VRAM. +| Model Size | GPU | Comment | +|-----------|--------|-----------------------------------------------------------| +| 7B | 8GB Vram | ⚠️ Not recommended. Performance is poor, frequent hallucinations, and planner agents will likely fail. | +| 14B | 12 GB VRAM (e.g. RTX 3060) | ✅ Usable for simple tasks. May struggle with web browsing and planning tasks. | +| 32B | 24+ GB VRAM (e.g. RTX 4090) | 🚀 Success with most tasks, might still struggle with task planning | +| 70B+ | 48+ GB Vram (eg. rtx 4090) | 💪 Excellent. Recommended for advanced use cases. | **Q: Why Deepseek R1 over other models?** diff --git a/sources/agents/browser_agent.py b/sources/agents/browser_agent.py index 3e85e13..9d5bc5e 100644 --- a/sources/agents/browser_agent.py +++ b/sources/agents/browser_agent.py @@ -341,7 +341,7 @@ class BrowserAgent(Agent): complete = True break - if link == None or Action.GO_BACK.value in answer or link in self.search_history: + if (link == None and not len(extracted_form)) or Action.GO_BACK.value in answer or link in self.search_history: pretty_print(f"Going back to results. Still {len(unvisited)}", color="status") unvisited = self.select_unvisited(search_result) prompt = self.make_newsearch_prompt(user_prompt, unvisited) diff --git a/sources/router.py b/sources/router.py index e95e2de..793c752 100644 --- a/sources/router.py +++ b/sources/router.py @@ -29,6 +29,7 @@ class AgentRouter: self.complexity_classifier = self.load_llm_router() self.learn_few_shots_tasks() self.learn_few_shots_complexity() + self.asked_clarify = False def load_pipelines(self) -> Dict[str, Type[pipeline]]: """ @@ -439,9 +440,11 @@ class AgentRouter: text = self.lang_analysis.translate(text, lang) labels = [agent.role for agent in self.agents] complexity = self.estimate_complexity(text) - if complexity == None: + if complexity == None and self.asked_clarify == False: + self.asked_clarify = True pretty_print(f"Humm, the task seem complex but you gave very little information. can you clarify?", color="info") return None + self.asked_clarify = False if complexity == "HIGH": pretty_print(f"Complex task detected, routing to planner agent.", color="info") return self.find_planner_agent()