Skip to content

dimonier/sgr-deep-research-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SGR Deep Research Client

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.

Features

  • 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_agent works fine, others not tested)
  • Structured Output: Formatted display of research plans, progress, and final answers

Prerequisites

  • Python 3.12 or higher
  • uv package manager

Installation

  1. 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
  1. Clone the repository:
git clone https://github.com/dimonier/sgr-deep-research-client.git
cd sgr-deep-research-client
  1. Install dependencies:
uv sync

This will automatically create a virtual environment and install all required dependencies (gradio, openai) as specified in pyproject.toml.

Configuration

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"

Usage

  1. Ensure the SGR Deep Research server is running on the configured endpoint (default: http://127.0.0.1:8088/v1)

  2. Launch the client:

uv run main.py

Alternatively, you can use the provided batch file on Windows:

run.bat
  1. 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
  1. 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)

How It Works

The client connects to the SGR Deep Research API and:

  1. Fetches available models/agents from the server
  2. Sends research requests using OpenAI-compatible API format
  3. Processes streaming responses containing tool calls and research progress
  4. Formats and displays structured output (research plans, steps, final answers)
  5. Handles clarification requests to refine or continue research (not implemented yet)

Troubleshooting

Connection errors:

  • Verify the SGR Deep Research server is running
  • Check the API_BASE_URL matches 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

About

A simple client for SGR Deep Research backend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors