Skip to main content
This guide walks you through setting up the Bifrost repository for local development, from prerequisites to running your first development server.

Prerequisites

Before setting up the repository, ensure you have the following tools installed:
  • Go (1.25.5)
  • Node.js (>= 18.0.0) and npm
  • Make
  • Docker (optional, for containerized development)
  • Air (for hot reloading, auto-installed by Makefile when needed)
  • golangci-lint (optional, for linting)
  • goimports (optional, for code formatting)
gotestsum and junit-viewer are auto-installed by make commands when needed for test reporting.

Clone the Repository

You should see the main directories: core/, framework/, transports/, ui/, plugins/, docs/, etc.

Repository Structure

Bifrost uses a modular architecture with the following structure:
The system uses a provider-agnostic approach with well-defined interfaces in core/schemas/ for easy extension to new AI providers. Learn More About the Architecture:

Development Environment Setup

If you’re setting up the repo for the first time, you may need to build the project at least once:
The fastest way to get started is using the complete development environment:
This command will:
  1. Install UI dependencies automatically
  2. Install Air for hot reloading
  3. Set up the Go workspace with local modules
  4. Start the Vite development server (port 3000)
  5. Start the API server with UI proxy (port 8080)
Access the application at: http://localhost:8080
The make dev command handles all setup automatically. You can skip the manual setup steps below if this works for you.

Alternative: Using Pulse

If you prefer Pulse over Air for hot reloading, use:
This runs the same development environment but uses pulse.yaml for hot reloading instead of .air.toml.

Manual Setup (Alternative)

If you prefer to set up components manually:

1. Install UI Dependencies

2. Install Air for Hot Reloading

3. Set Up Go Workspace

This creates a go.work file that links all local modules for development.

4. Build the Application

5. Run the Application

Available Make Commands

The Makefile provides numerous commands for development:

Development Commands

Testing Commands

  • TESTCASE must use forward-slash separated nested path format (e.g., ParentTest/SubTest/SpecificTest)
  • See the Makefile comment at line 311 for the expected format and additional examples
  • HTML test reports are automatically generated when junit-viewer is available
  • Reports are saved to test-reports/ directory
  • View with: open test-reports/index.html

Workspace Management

make work-init is deprecated. Use make setup-workspace instead.

UI Commands

Docker Commands

Documentation

Code Quality

Tool Installation

Environment Variables

You can customize the development environment with these variables:
Example with custom settings:

Understanding Bifrost Architecture

Before diving into development, it’s helpful to understand how Bifrost works internally. The architecture documentation provides detailed insights into:

Core Components

Framework Layer

Plugins & Transports

Reading the architecture documentation will help you understand where to make changes and how different components interact.

Development Workflow

1. Start Development Environment

2. Make Your Changes

  • Core changes: Edit files in core/
  • API changes: Edit files in transports/bifrost-http/
  • UI changes: Edit files in ui/
  • Plugin changes: Edit files in plugins/

3. Test Your Changes

4. Verify Code Quality

5. Build for Production

Troubleshooting

Common Issues

Go workspace issues:
UI dependency issues:
Port conflicts:
If an process is running on a port you need to use, you may need to terminate or kill it first:
Hot reload not working:

Getting Help

  • Check logs: Development logs appear in your terminal
  • Verify prerequisites: Ensure Go, Node.js, and make are properly installed
  • Clean build: Run make clean and try again
  • Discord: Join our Discord community for real-time help

Next Steps

Once your development environment is running:
  1. Explore the UI: Visit http://localhost:8080 to see the web interface
  2. Make API calls: Test the API endpoints at http://localhost:8080/v1/
  3. Understand the architecture: Read our request flow documentation to understand how Bifrost works internally
  4. Read the documentation: Check out our complete documentation
  5. Review contribution guidelines: See our code conventions and PR guidelines

Quick Reference

Happy coding! πŸš€