# DefaultChatRuntime



# Overview

The default implementation of `ChatRuntime`. It powers the server-side chat behavior, including streaming responses and request handling. For most cases, use [createChat](/docs/api-reference/server/create-chat) to configure it.

## Type Definition

```ts
import type { ChatExecutionContext, ChatRuntime, ChatRuntimeOptions, ChatStreamInput } from 'peam/server';
import type { InferUIMessageChunk, UIMessage } from 'ai';

export declare class DefaultChatRuntime implements ChatRuntime {
  constructor(options?: ChatRuntimeOptions);
  stream(input: ChatStreamInput, context: ChatExecutionContext): ReadableStream<InferUIMessageChunk<UIMessage>>;
  handler(request: Request): Promise<Response>;
}
```

## Usage

```ts
import { DefaultChatRuntime } from 'peam/server';

const runtime = new DefaultChatRuntime();
export const POST = runtime.handler;
```

## Notes

* If `searchIndexStore` is not provided, it uses a file-based store at `.peam/index.json`.
* The handler expects the `ChatRequestBody` payload (see [createChat](/docs/api-reference/server/create-chat)).
* Summarization defaults to [WindowedConversationSummarizer](/docs/api-reference/server/windowed-conversation-summarizer).


## Sitemap
[Overview of all docs pages](/sitemap.md)
