Modern Angular 20 library for embedding OpenWebUI chat in your applications with full conversation history, markdown support, and Angular 2025 architecture.
Interactive demo showcasing all features:
- Dynamic configuration
- Model selection
- Real-time chat with conversation history
- Markdown rendering
- Multi-language support
- 🚀 Angular 2025 Ready - Zoneless, Signals, Modern file structure
- 💬 Conversation History - AI remembers all previous messages
- 📝 Markdown Support - Rich text rendering with ngx-markdown
- ⚡ Signals & Zoneless - Latest Angular reactive patterns
- 📡 Streaming Responses - Real-time chat with typing indicator
- ⏹️ Stop Generation - Cancel AI response at any time
- 🎤 Voice Input - Record audio messages with automatic transcription
- 🌍 Multi-language - 10 languages supported
- 🎨 Customizable - SCSS with modern features
- 🔧 TypeScript - Full type safety
- 📱 Responsive - Mobile-friendly design
- ⭐ Response Actions - Continue, regenerate, and rate responses
- 👍 Rating System - Comprehensive feedback with good/bad ratings
npm install ngx-open-web-ui-chatimport { bootstrapApplication } from '@angular/platform-browser';
import { provideZonelessChangeDetection } from '@angular/core';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { provideMarkdown } from 'ngx-markdown';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [
provideZonelessChangeDetection(), // Zoneless mode!
provideHttpClient(withInterceptorsFromDi()),
provideMarkdown() // For markdown rendering
]
}).catch((err) => console.error(err));import { Component } from '@angular/core';
import { OpenwebuiChatComponent } from 'ngx-open-web-ui-chat';
@Component({
standalone: true,
imports: [OpenwebuiChatComponent],
template: `
<openwebui-chat
[endpoint]="'https://your-openwebui-instance.com'"
[modelId]="'llama3'"
[apiKey]="'sk-your-api-key'">
</openwebui-chat>
`
})
export class AppComponent {}The component automatically maintains conversation context:
[
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi! How can I help?"},
{"role": "user", "content": "What did I just say?"},
{"role": "assistant", "content": "You said 'Hello'"}
]Features:
- ✅ Full conversation history sent with each request
- ✅ AI remembers all previous messages
- ✅ Context-aware responses
Zoneless Change Detection:
provideZonelessChangeDetection() // No ZoneJS!Signals for State:
messages = signal<ChatMessage[]>([]);
isLoading = signal(false);Modern File Structure:
components/
├── openwebui-chat.ts ← Logic
├── openwebui-chat.html ← Template
└── openwebui-chat.scss ← Styles (SCSS!)
openwebui-ts-embedded-sdk/
├── projects/
│ └── ngx-open-web-ui-chat/ # Library package
│ ├── src/lib/
│ │ ├── components/
│ │ │ ├── openwebui-chat.ts
│ │ │ ├── openwebui-chat.html
│ │ │ ├── openwebui-chat.scss
│ │ │ ├── chat-input/
│ │ │ ├── chat-message/
│ │ │ ├── error-banner/
│ │ │ ├── message-actions/
│ │ │ ├── rating-form/
│ │ │ └── regenerate-menu/
│ │ ├── services/
│ │ │ └── openwebui-api.ts
│ │ ├── models/
│ │ │ └── chat.model.ts
│ │ └── i18n/
│ │ └── translations.ts
│ └── dist/ # Built package
├── test-app/ # Test application
│ ├── src/app/
│ │ ├── app.component.ts
│ │ ├── app.component.html
│ │ └── app.component.scss
│ └── package.json
├── docs/ # Documentation
│ ├── API.md
│ ├── I18N.md
│ ├── MARKDOWN.md
│ └── CHANGELOG.md
├── README.md # This file
└── package.json
| Input | Type | Required | Default | Description |
|---|---|---|---|---|
endpoint |
string |
✅ | - | OpenWebUI instance URL |
modelId |
string |
✅ | - | AI model identifier |
apiKey |
string |
✅ | - | API key |
enableMarkdown |
boolean |
❌ | true |
Enable markdown |
debug |
boolean |
❌ | false |
Debug logging |
language |
string |
❌ | 'en' |
UI language |
| Output | Type | Description |
|---|---|---|
chatInitialized |
EventEmitter<void> |
Chat session ready |
messagesChanged |
EventEmitter<number> |
Message count changed |
| Method | Description |
|---|---|
sendMessage(message: string) |
Send a message programmatically |
stopGeneration() |
Stop current AI response generation |
clearChat() |
Clear all messages |
createNewChat() |
Create new chat session |
changeModel(modelId: string) |
Switch to different model |
cd projects/ngx-open-web-ui-chat
npm run buildOutput: projects/ngx-open-web-ui-chat/dist/
cd test-app
npm startVisit: http://localhost:4200
Features:
- Dynamic host & API key configuration
- Model selection
- Progressive connection flow
- Chat controls (clear, disconnect, language)
- Beautiful UI with step-by-step guide
| Document | Description |
|---|---|
| API Reference | Complete API documentation |
| Markdown Guide | Markdown features & examples |
| I18N Guide | Multi-language support |
- Angular 20.x - Latest framework with signals
- TypeScript 5.8 - Full type safety
- ng-packagr - Library packaging
- ngx-markdown - Markdown rendering
- RxJS - Only for streaming (Angular 2025 pattern)
- SCSS - Modern styling with nesting
✅ Zoneless Change Detection - No ZoneJS overhead
✅ Signals - Reactive state management
✅ Standalone Components - No NgModules
✅ Modern File Structure - Separated TS/HTML/SCSS
✅ inject() DI - Modern dependency injection
✅ Async/Await - Instead of Observable where appropriate
✅ Computed Properties - Derived state
<openwebui-chat
[endpoint]="'https://ai.example.com'"
[modelId]="'llama3'"
[apiKey]="'sk-abc123'">
</openwebui-chat>import { Component, ViewChild } from '@angular/core';
import { OpenwebuiChatComponent } from 'ngx-open-web-ui-chat';
@Component({
template: `
<button (click)="clearChat()">Clear</button>
<button (click)="sendGreeting()">Say Hi</button>
<openwebui-chat
#chat
[endpoint]="endpoint"
[modelId]="modelId"
[apiKey]="apiKey"
(messagesChanged)="onMessageCount($event)">
</openwebui-chat>
<p>Messages: {{ messageCount }}</p>
`
})
export class AppComponent {
@ViewChild('chat') chat?: OpenwebuiChatComponent;
messageCount = 0;
clearChat() {
this.chat?.clearChat();
}
sendGreeting() {
this.chat?.sendMessage('Hello!');
}
onMessageCount(count: number) {
this.messageCount = count;
}
}<openwebui-chat
[endpoint]="endpoint"
[modelId]="modelId"
[apiKey]="apiKey"
[language]="'en'">
</openwebui-chat>Supported languages: en, zh, hi, es, ar, fr, pt, ru, bn, ja
# 1. Build
cd projects/ngx-open-web-ui-chat
npm run build
# 2. Publish
cd dist
npm publish --access public- Fork the repository
- Create a feature branch
- Make changes
- Test thoroughly
- Submit pull request
MIT License - see LICENSE file for details
- ✅ Angular 2025 Architecture - Zoneless, signals, modern patterns
- ✅ Separation of Concerns - TS/HTML/SCSS files
- ✅ Type Safety - Full TypeScript strict mode
- ✅ SCSS Features - Nesting, variables, modern CSS
- ✅ Conversation Context - Full history maintained
- ✅ Event-Driven - Reactive communication
- ✅ Responsive Design - Mobile-friendly
- ✅ Clean Code - Following Angular style guide
- File upload support
- Response interaction controls (continue, regenerate, rate)
- Comprehensive rating system
- Voice input with transcription
- Export chat history
- Custom themes
The component includes voice recording with automatic transcription:
- Click microphone button to start recording
- Real-time spectrogram visualization
- Automatic transcription via OpenWebUI API
- Editable transcribed text
- Error handling with retry mechanism
- Modern browser with Web Audio API
- Microphone permission
- HTTPS connection (browser security requirement)
Status: Production-ready v1.0.9
Angular Version: 20.x
Node Required: >=20.19.0
Made with ❤️ using Angular 2025 architecture