Skip to content
/ g1 Public
forked from Theigrams/g1

g1: Using GPT-4o to create o1-like reasoning chains

License

Notifications You must be signed in to change notification settings

IAn2018cs/g1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

g1: Enhanced Reasoning Chains with GPT-4o

Example 1 Example 2

Overview

This repository is an enhanced version of the original g1 project, which uses GPT-4o to create o1-like reasoning chains. The enhancements include additional features, improved UI, and better customization options. One significant improvement is the transition from Groq to an OpenAI-compatible API, implemented using litellm.

New Features

  • OpenAI API: The system now uses the OpenAI API for enhanced performance and reliability.
  • API Configuration: Added input fields for API key and base URL in the sidebar, along with a "Save API Settings" button to update environment variables.
  • Enhanced UI: Improved styling and layout for a better user experience.
  • Downloadable Reasoning Chains: Users can download the full reasoning chain in JSON format.

Quickstart

To get started with the Streamlit UI, follow these steps:

  1. Create a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  2. Install the required dependencies:

    pip3 install -r requirements.txt
  3. Set your OpenAI API key:

    export OPENAI_API_KEY=sk-...
  4. Run the Streamlit app:

    streamlit run app.py

Usage

  1. Model Settings: Select the desired model from the sidebar.
  2. Generation Settings: Adjust the maximum number of reasoning steps and the temperature parameter for generation.
  3. API Settings: Enter your API key and base URL, then save the settings to update the environment variables.
  4. Query Input: Use the input field to enter your query.
  5. Response Generation: The system will generate a step-by-step reasoning chain, displaying each step, the final answer, and the thinking time for each reasoning step.

Downloading Results

Once the reasoning process is complete, you can download the full reasoning chain in JSON format using the provided download link.

Configuration

Environment variables are used for API configuration:

  • OPENAI_API_KEY: Your OpenAI API key.
  • OPENAI_API_BASE: The base URL for the API (optional).

These can be set manually or through the UI using the provided fields in the sidebar.

About

g1: Using GPT-4o to create o1-like reasoning chains

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%