An Open-Source AI Chat Interface
LibreKAi is a self-hostable AI chat application designed to work seamlessly with local LLMs such as llama.cpp. 日本語の説明は下にあります。
This application is currently under development and may contain bugs or other issues. It is not recommended for use in production environments at this stage.
If you are kind enough to help fix these issues, I would be more than happy to receive your Pull Requests!
- 🔌 Plugin System: Flexibly extend functionality with authentication, point systems, and more.
- 🗄️ PostgreSQL-Based Configuration: Manage settings directly through the web interface.
- 🔒 Security-Focused: Equipped with Helmet, CORS, and CSP out of the box.
- 🚀 Self-Hosted: Maintain complete control over your data on your own server.
- 🌐 Local LLM Support: Integrates with llama.cpp and other OpenAI-compatible APIs.
- Node.js 18 or higher
- PostgreSQL 12 or higher
- llama.cpp (or any other OpenAI-compatible LLM server)
git clone https://github.com/Kaisan10/LibreKAi.git
cd LibreKAinpm installpsql -U postgres
CREATE DATABASE librekai;
\qcp .env.example .env
nano .envPlease edit the following required fields:
DB_HOST,DB_USER,DB_PASS,DB_NAME: PostgreSQL connection details.SESSION_SECRET: A random string of at least 32 characters.SITE_URL: Your site's URL (e.g.,https://ai.example.com).ADMIN_USERNAME: Administrator username.
npm startThe server will be running at http://localhost:3008.
Access http://localhost:3008/admin/models in your browser to add models.
- ENV_CONFIG.md: Detailed environment variables and settings.
- guide.md: Administrator Guide.
- docs/plugin-policy.md: Plugin Development Guide.
LibreKAi manages settings in two ways:
Essential settings required to boot the application:
- Database connection details
- Session secret
- Site URL
- Administrator username
Settings manageable via the /admin page:
- External API integrations (Discourse, point systems, etc.)
- URL shortener settings
- Security policies (CORS, CSP)
For more details, see ENV_CONFIG.md.
You can extend LibreKAi's functionality using plugins.
Simply place a JavaScript file in lib/plugins/ and it will be loaded automatically.
Available plugin types:
- auth: Authentication providers (e.g., Discourse SSO, Google OAuth, etc.)
- points: Point system integrations
For more details, see docs/plugin-policy.md.
# Start in development mode
NODE_ENV=development npm startGNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
Key AGPL-3.0 requirements:
- You must disclose the source code of any modified versions when providing the service over a network.
- Any modified versions must be released under the same license.
Pull Requests are welcome!
Dedicated to all the wonderful open-source projects.
If you encounter any issues, please report them via Issues or on the Forum.
I have always been supported by open-source projects throughout my journey. I created this project as a small way to give back to the community.
Made with ❤️ by the LibreKAi community
オープンソースのAIチャットインターフェース
LibreKAiは、llama.cppなどのローカルLLMと連携して動作する、セルフホスト可能なAIチャットアプリケーションです。
このアプリはまだ開発中でバグや、様々な問題があります。 本番環境で使うことはあまりお勧めしません。
もし、この問題を直してくれる優しい人がいればプルリクエストを送信してくれると嬉しいです。
- 🔌 プラグインシステム: 認証、ポイントシステムなどを柔軟に拡張
- 🗄️ PostgreSQLベースの設定管理: Webインターフェースから設定を変更可能
- 🔒 セキュリティ重視: Helmet、CORS、CSPを標準装備
- 🚀 セルフホスト: 自分のサーバーで完全にコントロール可能
- 🌐 ローカルLLM対応: llama.cppなどのOpenAI互換APIと連携
- Node.js 18以上
- PostgreSQL 12以上
- llama.cpp(または他のOpenAI互換LLMサーバー)
git clone https://github.com/Kaisan10/LibreKAi.git
cd LibreKAinpm installpsql -U postgres
CREATE DATABASE librekai;
\qcp .env.example .env
nano .env必須項目を編集してください:
DB_HOST,DB_USER,DB_PASS,DB_NAME: PostgreSQL接続情報SESSION_SECRET: ランダムな32文字以上の文字列SITE_URL: サイトのURL(例:https://ai.example.com)ADMIN_USERNAME: 管理者ユーザー名
npm startサーバーは http://localhost:3008 で起動します。
ブラウザで http://localhost:3008/admin/models にアクセスし、モデルを追加してください。
- ENV_CONFIG.md: 環境変数と設定の詳細
- guide.md: 管理者ガイド
- docs/plugin-policy.md: プラグイン開発ガイド
LibreKAiは2つの方法で設定を管理します:
起動に必要な最低限の設定:
- データベース接続情報
- セッションシークレット
- サイトURL
- 管理者ユーザー名
/admin/ ページから管理できる設定:
- 外部API連携(Discourse、ポイントシステムなど)
- 短縮URL設定
- セキュリティポリシー(CORS、CSP)
詳細は ENV_CONFIG.md を参照してください。
LibreKAiはプラグインで機能を拡張できます:
lib/plugins/ にJavaScriptファイルを配置するだけで自動ロードされます。
プラグインの種類:
- auth: 認証プロバイダー(例: Discourse SSO、Google OAuth等)
- points: ポイントシステム連携
詳細は docs/plugin-policy.md を参照してください。
# 開発モードで起動
NODE_ENV=development npm startGNU Affero General Public License v3.0 (AGPL-3.0) - 詳細は LICENSE を参照してください。
AGPL-3.0の主な要件:
- ネットワーク越しにサービスを提供する場合も、改変したソースコードを公開する義務があります
- 改変して配布する場合も、同一ライセンスで公開する必要があります
プルリクエストを歓迎します!
素晴らしいオープンソースプロジェクト
問題が発生した場合は、Issuesまたはフォーラムで報告してください。
私は今までオープンソースのプロジェクトに支えられてきました。 なので少しでも恩返しをしようと、このプロジェクトを作りました。
Made with ❤️ by the LibreKAi community