-
Notifications
You must be signed in to change notification settings - Fork 1
Web Search Notes
XuanXuanxuannn edited this page Apr 30, 2025
·
2 revisions
This wiki explains how to set up and use the Modelworks Gradio chat application, which integrates OllamaLLM with live web search via SerpAPI.
- Python 3.8+
- Virtual environment (recommended)
-
Ollama server running locally with a model loaded (e.g.,
deepseek-r1:1.5b). - SerpAPI account and API key.
-
Clone your repo (or copy
main.pyinto your project directory):git clone <your-repo-url> cd <your-project>
- Create and activate a Python virtual environment: python3 -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows
- Install dependencies
pip install --upgrade \ gradio \ langchain[serpapi] \ langchain-community \ langchain-ollama
-
Start Ollama with your chosen model
ollama serve --model gemma3:1b
-
Set your SerpAPI key in the environment
# macOS / Linux export SERPAPI_API_KEY="your_serpapi_key" # Windows PowerShell setx SERPAPI_API_KEY "your_serpapi_key"
project/
βββ main.py # Gradio app with web search agent
βββ venv/ # Python virtual environment
βββ requirements.txt # optionally freeze your deps
With your venv activated and Ollama running:
python main.pyBy default, the Gradio UI will launch at http://localhost:7860.
- Open your browser at http://localhost:7860.
- Type a query in the chatbox (e.g., βWhatβs the latest news on renewable energy?β).
- Send β the agent will:
- Optionally call SerpAPI to fetch real-time web results.
- Combine its reasoning with those results.
- Return a final answer in the chat UI.
Welcome to the ModelWorks Wiki! Use the links below to navigate our resources quickly.
Product Information
- π¦ !! JoeyLLM Guide !! π¦
- Shared Product Vision
- Personas, Scenarios, & User Stories
- Procedure to Resolve Conflicts
- Project Milestones
- Decision Making Protocol
- Story Point Estimation Algorithm
- Gradio Notes
- Javascript Notes (split into two)
- Ollama Notes
- Langchain Notes
- Chroma Notes
- GPU Monitor Notes
- Open WebUI Notes
- Web Search Notes
- Chat History Notes
- Meeting Minute 1
- Meeting Minute 2
- Meeting Minute 3
- Meeting Minute 4
- Meeting Minute 5
- Meeting Minute 6
- Meeting Minute 7
- Meeting Minute 8
- Meeting Minute 9
- Meeting Minute 10
- Meeting Minute 11