Skip to content

About

Liyn-at-Home is an AI virtual avatar interaction system designed for personal deployment and desktop browser use. It provides capabilities such as chat, voice, 3D character display, scene switching, proactive conversation, interactive events, and external robot integration.

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Liyn-at-Home

Version: 1.0.3
License: GNU Affero General Public License v3.0
Default language: Chinese

Liyn-at-Home is a web-based AI companion and virtual character interface. It combines conversational AI, 3D avatar rendering, voice interaction, scene management, and external bot connectivity in a single browser application.

The project is designed for users who want to run a personal AI companion interface at home or on a private server, with direct support for connecting to AstrBot through its WebAPI.

中文说明

项目简介

Liyn-at-Home 是一个面向个人部署和桌面浏览器使用的 AI 虚拟形象交互系统。它提供聊天、语音、3D 角色展示、场景切换、主动对话、互动事件和外部机器人接入能力。

本项目重点支持 AstrBot WebAPI 连接。你可以在界面中配置 AstrBot 的 WebAPI 地址和 API Key,让 Liyn-at-Home 将用户消息转发给 AstrBot,并接收 AstrBot 的回复。该模式适合已经在本地或服务器上运行 AstrBot 的用户。

主要能力

  • AI 对话界面:支持普通文本对话、流式输出和多轮上下文。
  • AstrBot WebAPI 接入:支持配置 AstrBot WebAPI 地址、API Key、用户名称和会话映射。
  • 3D 虚拟形象:基于 VRM 模型渲染,支持动作、表情、场景和模型设置。
  • 语音交互:支持语音输入、TTS 输出和多种语音服务的运行时配置。
  • 主动对话:可根据时间、状态和互动记录触发主动消息。
  • 互动事件:支持类似视觉小说的选项式互动和状态变化。
  • 场景与资源管理:支持自定义场景、背景、模型资源和服务端资源缓存。
  • 图像与编辑工具:包含图像编辑、分割、画布和素材管理能力。
  • 第三方模型配置:支持通过环境变量或界面配置外部模型服务。

AstrBot WebAPI 连接

Liyn-at-Home 内置 AstrBot 配置入口,支持以下能力:

  • 保存多个 AstrBot 服务端配置。
  • 使用 baseUrl 和 apiKey 连接 AstrBot WebAPI。
  • 测试 AstrBot 连接可用性。
  • 将 Liyn 会话映射到 AstrBot 会话。
  • 可选择是否向 AstrBot 注入当前系统提示词。
  • 支持非流式和流式响应适配。

典型配置项:

ASTRBOT_BASE_URL=
ASTRBOT_API_KEY=

也可以直接在应用设置界面中填写 AstrBot WebAPI 地址和 API Key。

环境要求

  • Node.js 20 或更高版本
  • npm
  • 现代浏览器

快速开始

安装依赖:

npm install

创建 .env.local:

BAILIAN_BASE_URL=
BAILIAN_API_KEY=
BAILIAN_DEFAULT_MODEL=

SILICONFLOW_BASE_URL=
SILICONFLOW_API_KEY=
SILICONFLOW_DEFAULT_MODEL=

DOUBAO_BASE_URL=
DOUBAO_API_KEY=
DOUBAO_DEFAULT_MODEL=
DOUBAO_VISION_MODEL=
DOUBAO_WEB_SEARCH_MODEL=

DASHSCOPE_API_KEY=
DASHSCOPE_BASE_URL=
DASHSCOPE_WS_URL=
DASHSCOPE_VOICE_MANDARIN=
DASHSCOPE_VOICE_CANTONESE=

QWEN_TTS_HTTP_URL=
QWEN_TTS_WS_URL=
QWEN_ASR_WS_URL=

COSYVOICE_ENDPOINT=
COSYVOICE_VOICE=

MINIMAX_ENDPOINT=
MINIMAX_KEY=
MINIMAX_GROUP_ID=
MINIMAX_VOICE_ID=

BAIDU_EMOTION_API_ENDPOINT=
BAIDU_OAUTH_URL=
BAIDU_API_KEY=
BAIDU_API_SECRET_KEY=

启动开发服务器:

npm run dev

访问:

http://localhost:3000

常用命令

npm run dev
npm run build
npm run start
npm run lint
npm test

配置说明

本仓库不内置 API Key、API URL、音色 ID 或私人人设。所有服务地址和凭据都应通过环境变量或应用设置提供。

生产部署时建议:

  • 使用 .env.local 或平台 Secret 管理服务保存密钥。
  • 不要将 .env* 文件提交到 Git。
  • 为 AstrBot、模型服务和 TTS 服务分别使用独立凭据。
  • 定期轮换 API Key。
  • 使用 HTTPS 反向代理保护公开访问入口。

许可证

本项目使用 GNU Affero General Public License v3.0 发布。你可以自由使用、修改和分发本项目,但如果你修改后通过网络向用户提供服务,也需要按 AGPLv3 要求公开对应源代码。

完整许可证文本见 LICENSE。


English

Overview

Liyn-at-Home is a web-based AI companion interface for personal deployment and browser-based use. It provides chat, voice interaction, 3D avatar rendering, scene switching, proactive dialogue, interactive events, and external bot integration.

The project has first-class support for connecting to AstrBot through AstrBot WebAPI. If you already run AstrBot locally or on a private server, Liyn-at-Home can forward user messages to AstrBot and display AstrBot responses in the web interface.

Key Features

  • AI chat interface with multi-turn context and streaming responses.
  • AstrBot WebAPI integration with configurable base URL, API Key, username, and session mapping.
  • 3D virtual avatar rendering with VRM model support, animation, expressions, scenes, and model settings.
  • Voice input and TTS output with runtime service configuration.
  • Proactive dialogue based on time, state, and interaction history.
  • Visual-novel-style interactive choices and state changes.
  • Scene and asset management with server-side asset caching.
  • Image editing, segmentation, canvas tools, and material management.
  • Third-party model configuration through environment variables or in-app settings.

AstrBot WebAPI Integration

Liyn-at-Home includes built-in AstrBot settings and supports:

  • Multiple AstrBot server configurations.
  • WebAPI connection through baseUrl and apiKey.
  • Connection testing.
  • Liyn session to AstrBot session mapping.
  • Optional system prompt injection.
  • Non-streaming and streaming response adaptation.

Typical environment variables:

ASTRBOT_BASE_URL=
ASTRBOT_API_KEY=

You can also configure AstrBot directly in the application settings panel.

Requirements

  • Node.js 20 or later
  • npm
  • A modern browser

Quick Start

Install dependencies:

npm install

Create .env.local:

BAILIAN_BASE_URL=
BAILIAN_API_KEY=
BAILIAN_DEFAULT_MODEL=

SILICONFLOW_BASE_URL=
SILICONFLOW_API_KEY=
SILICONFLOW_DEFAULT_MODEL=

DOUBAO_BASE_URL=
DOUBAO_API_KEY=
DOUBAO_DEFAULT_MODEL=
DOUBAO_VISION_MODEL=
DOUBAO_WEB_SEARCH_MODEL=

DASHSCOPE_API_KEY=
DASHSCOPE_BASE_URL=
DASHSCOPE_WS_URL=
DASHSCOPE_VOICE_MANDARIN=
DASHSCOPE_VOICE_CANTONESE=

QWEN_TTS_HTTP_URL=
QWEN_TTS_WS_URL=
QWEN_ASR_WS_URL=

COSYVOICE_ENDPOINT=
COSYVOICE_VOICE=

MINIMAX_ENDPOINT=
MINIMAX_KEY=
MINIMAX_GROUP_ID=
MINIMAX_VOICE_ID=

BAIDU_EMOTION_API_ENDPOINT=
BAIDU_OAUTH_URL=
BAIDU_API_KEY=
BAIDU_API_SECRET_KEY=

Start the development server:

npm run dev

Open:

http://localhost:3000

Common Commands

npm run dev
npm run build
npm run start
npm run lint
npm test

Configuration Notes

This repository does not include API keys, API URLs, voice IDs, or private persona content. All service endpoints and credentials should be provided through environment variables or application settings.

For production deployments:

  • Store credentials in .env.local or a secret management service.
  • Do not commit .env* files.
  • Use separate credentials for AstrBot, model providers, and TTS services.
  • Rotate API keys regularly.
  • Use HTTPS reverse proxying for public access.

License

This project is licensed under the GNU Affero General Public License v3.0. You may use, modify, and distribute the project, but if you provide a modified version as a network service, you must make the corresponding source code available under the terms of AGPLv3.

See LICENSE for the full license text.

About

Liyn-at-Home is an AI virtual avatar interaction system designed for personal deployment and desktop browser use. It provides capabilities such as chat, voice, 3D character display, scene switching, proactive conversation, interactive events, and external robot integration.

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages