チャズはチャズです。
これは、複数のLLMプロバイダーに接続して、LLMモデルのいずれかとチャットできるマトリックスボットです。 OpenAI APIを使用して、任意のモデルと互換性があります。
さらに、Aichatをプロバイダーとして使用することも可能であるため、Aichatを介して利用可能なモデルにもアクセスできます。
独自のAPIキーまたは既に構成されている独自のローカルAIが必要です。
アナウンスブログ投稿:Chaz:LLM <-> Matrix Chatbot
#chaz:jackson.devで利用できるパブリックマトリックスルームがあります
あなたが独自のAPIキーを持っていて、あなたがそれらを乱用しないことを私に信頼しているなら、あなたは@chaz:Jackson.devですぐに始めることができます。そのMatrixユーザーを部屋に追加し、OpenAI API互換のバックエンドに独自のAPIキーで構成するだけで、行ってもいいです。
Chazは、 allow_listのユーザーの招待状を自動的に受け入れます。
部屋にいるときは、 !chazが付けられたコマンドを監視します。 DMの場合、コマンドとして認識されないすべてのメッセージに応答します。大きな部屋にある場合、 !chazを使用して送信されるメッセージにのみ応答します。
そのため、大きな部屋で、 !chazを送信すると、部屋の最近のすべてのメッセージが送信され、応答を求められます。また!chaz explain that to meそれとともにリクエストを送信することもできます。
それが認識するコマンドは次のとおりです。
!chaz help
Available commands:
!chaz print - Print the conversation
!chaz send < message > - Send a message without context
!chaz model < model > - Select the model to use
!chaz backend < name > <api_base> <api_key> - Manually enter an OpenAI Compatible Backend
!chaz role [ < role > ] [ < prompt > ] - Get the role info, set the role, or define a new role
!chaz list - List available models
!chaz clear - Ignore all messages before this point
!chaz rename - Rename the room and set the topic based on the chat content
!chaz help - Show this message!chaz roleコマンドは、0、1、または多くの引数を取ります。
!chaz role使用して、現在の役割を示し、利用可能なすべての役割をリストします。!chaz role <name>を使用して、既存のロールをデフォルトとして設定します。!chaz role <name> <prompt>指定されたプロンプトで新しいロールを作成します。 chazはcrates.ioにのみパッケージ化されていますが、今のところGit Headから走ることをお勧めします。
nixユーザーの場合、このレポはnixフレークが含まれています。設定の詳細については、セットアップセクションを参照してください。
Docker Hubで利用可能なDocker画像があります。これがDocker Composeの例です。
services :
chaz :
image : arcuru/chaz:main # Set to your desired version
restart : unless-stopped
network_mode : host
volumes :
# Mount your config file to /config.yaml
- ./config.yaml:/config.yaml
# Mount your aichat config to /aichat, AND SET THAT LOCATION IN CHAZ'S CONFIG.YAML
- aichat-state:/aichat
- ./aichat.yaml:/aichat/config.yaml
# Mount the volume into the same location specified in config.yaml
- chaz-state:/state
volumes :
# Persists the logged in session
chaz-state :
aichat-state :これには、2つの構成ファイルをコンテナに取り付ける必要があることに注意してください。1つはChaz用、もう1つはAichat用です。また、CHAZ構成ファイルにState/Cache Directoriesを設定する必要があります。
Chaz構成ファイルは次のようになります。
homeserver_url : https://matrix.jackson.dev
username : " chaz "
password : " "
state_dir : " /state "
aichat_config_dir : " /aichat "
allow_list : " @.*:jackson.dev|@arcuru:matrix.org " まず、ボットを使用できるマトリックスサーバーにアカウントを設定します。
ログイン情報を使用して、ボットの構成ファイルを作成します。
重要:Alow_listまたはボットが応答しないことを確認してください
デフォルトはSRC/Defaults.RSで構成されています
homeserver_url : https://matrix.org
username : " chaz "
password : " " # Optional, if not given it will ask for it on first run
allow_list : " " # Regex for allowed accounts.
# message_limit: 0 # Set a per-account message limit, it will not allow more than this many messages per account.
# room_size_limit: 0 # Set a room size limit. It will refuse join if the room is too large.
state_dir : " $XDG_STATE_HOME/chaz " # Optional, for setting the chaz state directory
aichat_config_dir : " $AICHAT_CONFIG_DIR " # Optional, for using a separate aichat config
chat_summary_model : " " # Optional, set a different model than the default to use for summarizing the chat
disable_media_context : false # Optional, set to true to disable sending media context to aichat
role : chaz # Optionally set a role, AKA system prompt. Set to `chaz` for the full chaz experience, or `cave-chaz` for even more chaz
# Define backends. If more than 1 is defined, model names will be prefixed by the backends name.
# If none are defined, Chaz will look for Aichat
backends :
- name : openai # Name of the backend, models will be shown with this as a prefix, e.g. openai:gpt-4
type : openaicompatible
api_key :
api_base : https://api.openai.com/v1
models : # Listing models here is not necessary, but does make Chaz aware of them. You can still switch to a model not listed here through '!chaz model ....'
- name : gpt-4o
- name : gpt-4o-mini
- name : tog # Name can be anything. Model names will be "tog:<model>"
type : openaicompatible
api_key :
api_base : https://api.together.xyz/v1
- name : aic
type : aichat
roles : # Optional, define your own roles
- name : chaz # This one is predefined
description : Chaz is Chaz
prompt : " Your name is Chaz, you are an AI assistant, and you refer to yourself in the third person. "
example : # Optionally define example messages.
- user : User
message : " Are you ready? "
- user : Assistant
message : " Chaz is ready. "
- name : bash
description : Get a single shell command
prompt : >
Based on the following user description, generate a corresponding Bash shell command.
Focus solely on interpreting the requirements and translating them into a single, executable Bash command.
Ensure accuracy and relevance to the user's description.
The output should be a valid Bash command that directly aligns with the user's intent, ready for execution in a command-line environment.
Do not output anything except for the command.
No code block, no English explanation, no newlines, and no start/end tags. それを実行するには、単純に:
chaz --config config.yamlを指定します。ボットは、バックエンドの圧倒を防ぐために実行されていないときに送信された古いメッセージに応答しません。
Nixフレークを使用して開発が行われています。 Chazをインストールする最も簡単な方法は、Nixフレークを使用することです。
❯ nix run github:arcuru/chazフレークにはオーバーレイが含まれており、独自のフレーク構成に簡単にインポートできます。使用するには、入力に追加します。
inputs . chaz . url = "github:arcuru/chaz" ;次に、Overlay inputs.chaz.overlays.defaultをPKGに追加します。
フレークには、Chazをサービスとしてインストールするためのホームマネージャーモジュールも含まれています。モジュールをHome-Manager Configにインポートすると、Nix内からchazすべて構成できます。
{ inputs , ... } : {
imports = [ inputs . chaz . homeManagerModules . default ] ;
services . chaz = {
enable = true ;
settings = {
homeserver_url = "https://matrix.jackson.dev" ;
username = "chaz" ;
password = "hunter2" ;
allow_list = "@me:matrix.org|@myfriend:matrix.org" ;
} ;
} ;
} GithubとCodebergにミラーリングされています。 GitHubは公式のレポですが、どちらのレポを使用して貢献します。問題は同期できないため、複製がある可能性があります。