# Where to Find Lobe Chat Configuration Files: Complete Monorepo Guide

> Discover Lobe Chat configuration files within the monorepo. Find central settings in src/services/config.ts and build-time configs at the root. Simplify your setup now.

- Repository: [LobeHub/lobe-chat](https://github.com/lobehub/lobe-chat)
- Tags: how-to-guide
- Published: 2026-03-03

---

**Lobe Chat configuration files are distributed across build tooling, runtime services, router definitions, and feature-specific modules throughout the monorepo, with central application settings exposed via [`src/services/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/services/config.ts) and build-time configs residing at the repository root.**

The `lobehub/lobe-chat` repository organizes its configuration across multiple architectural layers to separate build-time tooling from runtime behavior. Whether you are customizing the Vite bundler, modifying feature flags, or adjusting serverless edge settings, understanding the location of Lobe Chat configuration files is essential for effective customization. All files referenced below are located in the **`canary`** branch on GitHub.

## Build and Tooling Configuration

Build-time settings define bundler behavior, compiler options, test runners, and container settings. These files reside at the repository root and control the development pipeline.

- **[`vite.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/vite.config.ts)** – Configures the Vite bundler for both web and desktop builds, handling plugins, optimizations, and dev server settings.
- **[`next.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/next.config.ts)** – Controls Next.js server-side rendering, image optimization, and experimental features.
- **[`tsconfig.json`](https://github.com/lobehub/lobe-chat/blob/main/tsconfig.json)** – Defines global TypeScript compiler options, path mappings, and strictness rules across the monorepo.
- **[`drizzle.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/drizzle.config.ts)** – Supplies database ORM connection strings and migration settings for Drizzle Kit.
- **`docker-compose/*/bucket.config.json`** – Configures S3-compatible storage buckets for development environments, typically found in [`docker-compose/dev/bucket.config.json`](https://github.com/lobehub/lobe-chat/blob/main/docker-compose/dev/bucket.config.json).

## Central Runtime Configuration

The application-wide runtime configuration lives in **[`src/services/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/services/config.ts)**. This central service exposes a `config` object used by both client and server code, holding global defaults such as API base URLs, theme settings, and feature toggles.

```tsx
import { config } from '@/services/config';

export const ThemeSwitcher = () => {
  const { theme, setTheme } = config.useTheme();

  return (
    <button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
      Switch to {theme === 'light' ? 'dark' : 'light'} mode
    </button>
  );
};

```

## Routing Configuration

Route definitions determine which pages load on desktop versus mobile devices. These configurations map route paths to layout components and are split by device type in the **`src/spa/router/`** directory.

- **[`src/spa/router/desktopRouter.config.tsx`](https://github.com/lobehub/lobe-chat/blob/main/src/spa/router/desktopRouter.config.tsx)** – Desktop-specific route definitions and layout wrappers.
- **[`src/spa/router/desktopRouter.config.desktop.tsx`](https://github.com/lobehub/lobe-chat/blob/main/src/spa/router/desktopRouter.config.desktop.tsx)** – Extended desktop routing for specific desktop builds.
- **[`src/spa/router/mobileRouter.config.tsx`](https://github.com/lobehub/lobe-chat/blob/main/src/spa/router/mobileRouter.config.tsx)** – Mobile-optimized route definitions with touch-friendly layouts.

```tsx
import { desktopRoutes } from '@/spa/router/desktopRouter.config';

desktopRoutes.push({
  path: '/custom',
  element: <CustomPage />,
});

```

## Feature-Specific Configuration

Individual features maintain isolated configuration files to enable granular control without modifying global settings. These modules reside within their respective feature directories under **`src/features/`**.

- **[`src/features/DataImporter/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/features/DataImporter/config.ts)** – Controls automatic import flows and parsing options.
- **[`src/features/ChatInput/ActionBar/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/features/ChatInput/ActionBar/config.ts)** – Defines action button visibility and behavior defaults.
- **[`src/features/AgentSetting/store/reducers/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/features/AgentSetting/store/reducers/config.ts)** – Manages agent configuration state reducers.
- **[`src/components/FileIcon/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/components/FileIcon/config.ts)** – Maps file extensions to icon components.

```ts
import { dataImporterConfig } from '@/features/DataImporter/config';

if (dataImporterConfig.enableAutoImport) {
  // trigger automatic import flow
}

```

## Third-Party and Server-Side Configuration

Integration-specific settings and serverless environment variables are isolated in dedicated library and business server directories.

- **[`src/libs/oidc-provider/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/libs/oidc-provider/config.ts)** – OpenID Connect provider endpoints and client credentials.
- **[`src/libs/better-auth/utils/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/libs/better-auth/utils/config.ts)** – Better-Auth SDK defaults for authentication flows.
- **[`src/libs/langchain/loaders/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/libs/langchain/loaders/config.ts)** – LangChain loader parameters and model endpoints.
- **[`src/business/server/lambda-routers/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/business/server/lambda-routers/config.ts)** – Environment-specific variables for serverless lambda functions.
- **[`packages/business/config/src/server/edge-config.ts`](https://github.com/lobehub/lobe-chat/blob/main/packages/business/config/src/server/edge-config.ts)** – Edge-runtime configuration for Vercel Edge Functions and similar platforms.

## Summary

- **Build configs** live at the repository root, including [`vite.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/vite.config.ts), [`next.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/next.config.ts), and [`tsconfig.json`](https://github.com/lobehub/lobe-chat/blob/main/tsconfig.json).
- **Central runtime settings** are exported from [`src/services/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/services/config.ts) as a hook-based API consumed across the application.
- **Route definitions** are split by device type in `src/spa/router/` with separate files for desktop and mobile.
- **Feature modules** contain localized configs like [`src/features/DataImporter/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/features/DataImporter/config.ts) for granular control.
- **Third-party integrations** and **serverless edge settings** are isolated in `src/libs/` and `src/business/server/` respectively.

## Frequently Asked Questions

### Where is the main configuration file in Lobe Chat?

There is no single monolithic configuration file. Instead, the central runtime configuration is located at **[`src/services/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/services/config.ts)**, which exports a `config` object used by both client components and server logic. Build-specific settings reside in root-level files like [`vite.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/vite.config.ts) and [`next.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/next.config.ts).

### How do I modify build settings like the bundler or TypeScript compiler?

Edit the root-level configuration files according to the tool you need to adjust. Modify **[`vite.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/vite.config.ts)** for bundler behavior, **[`next.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/next.config.ts)** for Next.js server settings, **[`tsconfig.json`](https://github.com/lobehub/lobe-chat/blob/main/tsconfig.json)** for TypeScript compiler options, and **[`drizzle.config.ts`](https://github.com/lobehub/lobe-chat/blob/main/drizzle.config.ts)** for database connection parameters.

### Can I configure feature-specific behavior without changing global settings?

Yes, feature modules export localized configuration objects that allow independent customization. Files such as **[`src/features/DataImporter/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/features/DataImporter/config.ts)** and **[`src/features/ChatInput/ActionBar/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/features/ChatInput/ActionBar/config.ts)** provide granular control over specific functionality without affecting the global service configuration.

### Where are serverless and edge runtime configurations stored?

Edge and lambda configurations reside in **[`src/business/server/lambda-routers/config.ts`](https://github.com/lobehub/lobe-chat/blob/main/src/business/server/lambda-routers/config.ts)** and **[`packages/business/config/src/server/edge-config.ts`](https://github.com/lobehub/lobe-chat/blob/main/packages/business/config/src/server/edge-config.ts)**. These files supply environment-specific variables and runtime settings for serverless functions deployed to edge networks.