A simple ChatGPT-like application built to test Langfuse tracing. This application lets you chat with an AI assistant while capturing detailed tracing information in Langfuse.
- Simple and intuitive chat interface
- OpenAI integration for AI responses
- Langfuse integration for LLM observability and tracing
- Session tracking to group related messages
- Real-time display of trace information
- Node.js (v14 or higher)
- An OpenAI API key
- A Langfuse account and API keys
-
Clone this repository:
git clone https://github.com/your-username/fuselage.git cd fuselage -
Install dependencies:
npm install -
Create a
.envfile in the root directory with the following variables:# OpenAI API configuration OPENAI_API_KEY=your_openai_api_key_here OPENAI_MODEL=gpt-3.5-turbo # Server configuration PORT=3000 # Langfuse configuration LANGFUSE_PUBLIC_KEY=your_langfuse_public_key LANGFUSE_SECRET_KEY=your_langfuse_secret_key LANGFUSE_HOST=https://cloud.langfuse.com -
Replace the placeholder values with your actual API keys.
Start the development server:
npm run dev
The application will be available at http://localhost:3000.
- Open the application in your browser
- Type a message in the input field and press "Send"
- View the AI response in the chat window
- See the trace information in the sidebar
- Click the link to view detailed tracing in the Langfuse dashboard
Each conversation creates a trace in Langfuse with spans for:
- User messages
- AI generations
You can view these traces in the Langfuse dashboard to analyze performance, errors, and other metrics.
MIT