Local web client for interacting with SGR Deep Research API.
This Gradio-based interface provides a simple way to conduct research sessions using the Schema-Guided Reasoning system through an intuitive web interface.
- Streaming Responses: Real-time streaming of research progress and results
- Interactive Clarification: Support for multi-turn clarification dialogs (not implemented yet)
- Model Selection: Choose from available models/agents exposed by the API (
sgr_agentworks fine, others not tested) - Structured Output: Formatted display of research plans, progress, and final answers
- Python 3.12 or higher
- uv package manager
- Install uv (if not already installed):
# On Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# On macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh- Clone the repository:
git clone https://github.com/dimonier/sgr-deep-research-client.git
cd sgr-deep-research-client- Install dependencies:
uv syncThis will automatically create a virtual environment and install all required dependencies (gradio, openai) as specified in pyproject.toml.
The client uses environment variables for configuration:
OPENAI_API_KEY(optional): API key for authentication. Can be left empty as the SGR server doesn't require authentication.API_BASE_URL(optional): Base URL for the SGR Deep Research API. Default:http://127.0.0.1:8088/v1
You can set these variables before running the client:
Windows (PowerShell):
$env:API_BASE_URL = "http://localhost:8088/v1"
$env:OPENAI_API_KEY = "your-key-here"Linux/macOS (bash):
export API_BASE_URL="http://localhost:8088/v1"
export OPENAI_API_KEY="your-key-here"-
Ensure the SGR Deep Research server is running on the configured endpoint (default:
http://127.0.0.1:8088/v1) -
Launch the client:
uv run main.pyAlternatively, you can use the provided batch file on Windows:
run.bat- Access the web interface:
The Gradio interface will launch automatically and be available at:
- Local:
http://127.0.0.1:7860 - Network: Check console output for the network URL
- Conduct research:
- Select a model from the dropdown (the first available model is selected by default)
- Enter your research question or request
- Click "Submit"
- View streaming results as the research progresses
- Answer clarification questions if prompted (not implemented yet)
The client connects to the SGR Deep Research API and:
- Fetches available models/agents from the server
- Sends research requests using OpenAI-compatible API format
- Processes streaming responses containing tool calls and research progress
- Formats and displays structured output (research plans, steps, final answers)
- Handles clarification requests to refine or continue research (not implemented yet)
Connection errors:
- Verify the SGR Deep Research server is running
- Check the
API_BASE_URLmatches your server configuration - Ensure no firewall is blocking the connection
No models available:
- Confirm the SGR server is properly configured and has models loaded
- Check server logs for errors