Back to .md Directory

Claude Code Instructions

This document provides instructions for Claude Code when working on this repository.

May 2, 2026
0 downloads
0 views
ai llm prompt claude openai gemini
View source

Claude Code Instructions

This document provides instructions for Claude Code when working on this repository.

Project Overview

This is a multi-model AI chatbot built with Flask. The project has two parallel versions:

  1. Original files - Full-featured version supporting multiple LLM providers
  2. New files (*_new.*) - Trimmed version supporting only OpenAI o3 and o1-pro models

File Structure

Original Files (DO NOT MODIFY)

FilePurpose
app.pyOriginal backend with all models (GPT-4o, GPT-4.1, o3, o4-mini, o3-mini, o1-pro, Claude, Gemini)
templates/index.htmlOriginal frontend with full model selection
templates/index2.htmlOriginal file viewer

New Files (Active Development)

FilePurpose
app_new.pyTrimmed backend - only o3 and o1-pro models
templates/index_new.htmlTrimmed frontend - only o3 and o1-pro in dropdown
templates/index2_new.htmlFile viewer for new version

Critical Rules

1. Preserve Original Files

NEVER modify the following files:

  • app.py
  • templates/index.html
  • templates/index2.html

These files serve as reference implementations. All new development should occur in the *_new.* files.

2. When Making Changes

  • All backend changes go in app_new.py
  • All frontend changes go in templates/index_new.html or templates/index2_new.html
  • If you need to reference original implementation, read from app.py or templates/index.html

3. Running the Application

To run the new trimmed version:

python app_new.py

To run the original full version:

python app.py

Current State of New Files

app_new.py

  • Supported models: o3, o1-pro only
  • API: OpenAI Responses API (non-streaming)
  • Both models use: store=True, reasoning={"effort": "high"}
  • Removed: Anthropic client, Gemini client, Claude thinking flag
  • Default model: o3

templates/index_new.html

  • Model dropdown: Only o3 and o1-pro options
  • Removed: Claude Extended Thinking checkbox
  • Streaming: Hardcoded to false (both models use non-streaming)

Adding New Features

When adding new functionality:

  1. First check if similar functionality exists in the original files
  2. Implement changes only in the *_new.* files
  3. Test thoroughly before considering backporting to original files
  4. Document any new endpoints or features in this file

API Endpoints (New Version)

EndpointMethodDescription
/GETMain chat interface
/get-tokenGETGenerate unique session token
/streamGETProcess prompt and return response
/select_modelPOSTChange active model
/savePOSTSave conversation
/autosavePOSTAuto-save conversation
/loadGETLoad previous conversation
/resetPOSTReset conversation
/shutdownPOSTShutdown server
/filecontentsGETFile viewer interface
/open_folderPOSTOpen folder picker
/load_selectionPOSTLoad selected files
/update-math-renderPOSTToggle math rendering

Notes

  • The new version removes all streaming logic since both o3 and o1-pro use the OpenAI Responses API which returns complete responses
  • Session management and conversation persistence work identically to the original
  • File viewer functionality is preserved unchanged

Related Documents