Chat UI documentation

Architecture

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Architecture

This document discusses the high level overview of the Chat UI codebase. If you’re looking to contribute or just want to understand how the codebase works, this is the place for you!

Overview

Chat UI provides a simple interface connecting LLMs to external information and tools. The project uses MongoDB and SvelteKit with Tailwind.

Code Map

This section discusses various modules of the codebase briefly. The headings are not paths since the codebase structure may change.

routes

Provides all of the routes rendered with SSR via SvelteKit. The majority of backend and frontend logic can be found here, with some modules being pulled out into lib for the client and lib/server for the server.

textGeneration

Provides a standard interface for most chat features such as model output, web search, assistants and tools. Outputs MessageUpdates which provide fine-grained updates on the request status such as new tokens and web search results.

endpoints / embeddingEndpoints

Provides a common streaming interface for many third party LLM and embedding providers.

websearch

Implements web search querying and RAG. See the Web Search section for more information.

tools

Provides a common interface for external tools called by LLMs. See the Tools section for more information

migrations

Includes all MongoDB migrations for maintaining backwards compatibility across schema changes. Any changes to the schema must include a migration

< > Update on GitHub