Examples of how to monitor the OpenAI SDK calls using Langfuse
20
stars
5
commits
JavaScript
primary language
Apr 7, 2025
updated
This project demonstrates how to implement request tracing and monitoring for OpenAI SDK calls using Langfuse. It provides a ready-to-use setup with Docker Compose for easy deployment on VPS environments.
⚠️ Production Notice: This setup is intended for development and testing. For production environments:
- Use Docker Swarm or Kubernetes instead of Docker Compose for better scalability and orchestration
- Configure SSL/TLS certificates (not included in this setup)
- Update all default credentials
- Consider implementing proper load balancing
Monitor and analyze your AI application's performance, costs, and behavior using Langfuse's powerful observability platform. This implementation uses the official Langfuse Docker Compose setup for self-hosting and includes Ollama integration for local LLM support.
git clone https://github.com/erickwendel/monitoring-llms-langfuse-ollama.git
cd monitoring-llms-langfuse-ollama
The project includes a default .env file with pre-configured settings:
docker compose up -d
This will:
http://localhost:3000
npm ci
npm run dev
sh scripts/run-request.sh
The project uses the official Langfuse Docker Compose configuration with the following main components:
Key environment variables in .env:
OPENAI_MODEL='gemma:2b'
DOMAIN=srv665452.hstgr.cloud # Update this for production
OPENAI_SITE_URL=http://${DOMAIN}:11434/v1
OPENAI_API_KEY='ollama'
OPENAI_SITE_NAME='Ollama'
# Pre-configured Langfuse keys
LANGFUSE_SECRET_KEY="sk-lf-fcc57d58-e494-421e-97d2-45e9c3302313"
LANGFUSE_PUBLIC_KEY="pk-lf-93c16cbd-c4f0-4b68-880e-5f1da1038032"
The setup follows Langfuse's recommended architecture for self-hosted instances:
Access your Langfuse dashboard to view:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please open an issue in this repository.
5 commits
JavaScript
51.8%
Shell
48.2%
Examples of how to monitor the OpenAI SDK calls using Langfuse
20
stars
5
commits
JavaScript
primary language
Apr 7, 2025
updated
This project demonstrates how to implement request tracing and monitoring for OpenAI SDK calls using Langfuse. It provides a ready-to-use setup with Docker Compose for easy deployment on VPS environments.
⚠️ Production Notice: This setup is intended for development and testing. For production environments:
- Use Docker Swarm or Kubernetes instead of Docker Compose for better scalability and orchestration
- Configure SSL/TLS certificates (not included in this setup)
- Update all default credentials
- Consider implementing proper load balancing
Monitor and analyze your AI application's performance, costs, and behavior using Langfuse's powerful observability platform. This implementation uses the official Langfuse Docker Compose setup for self-hosting and includes Ollama integration for local LLM support.
git clone https://github.com/erickwendel/monitoring-llms-langfuse-ollama.git
cd monitoring-llms-langfuse-ollama
The project includes a default .env file with pre-configured settings:
docker compose up -d
This will:
http://localhost:3000
npm ci
npm run dev
sh scripts/run-request.sh
The project uses the official Langfuse Docker Compose configuration with the following main components:
Key environment variables in .env:
OPENAI_MODEL='gemma:2b'
DOMAIN=srv665452.hstgr.cloud # Update this for production
OPENAI_SITE_URL=http://${DOMAIN}:11434/v1
OPENAI_API_KEY='ollama'
OPENAI_SITE_NAME='Ollama'
# Pre-configured Langfuse keys
LANGFUSE_SECRET_KEY="sk-lf-fcc57d58-e494-421e-97d2-45e9c3302313"
LANGFUSE_PUBLIC_KEY="pk-lf-93c16cbd-c4f0-4b68-880e-5f1da1038032"
The setup follows Langfuse's recommended architecture for self-hosted instances:
Access your Langfuse dashboard to view:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please open an issue in this repository.
5 commits
JavaScript
51.8%
Shell
48.2%