Chaz adalah Chaz.
Ini adalah bot matriks yang terhubung ke beberapa penyedia LLM untuk memungkinkan mengobrol dengan salah satu model LLM. Ini kompatibel dengan model apa pun menggunakan API OpenAI.
Selain itu, dimungkinkan juga untuk menggunakan AICHAT sebagai penyedia, sehingga setiap model yang tersedia melalui AICHAT juga dapat diakses.
Anda akan membutuhkan kunci API Anda sendiri atau AI lokal Anda sendiri yang sudah dikonfigurasi.
Posting Blog Pengumuman: Chaz: LLM <-> Matrix Chatbot
Ada ruang matriks publik yang tersedia di #chaz: jackson.dev
Jika Anda memiliki kunci API sendiri, dan Anda mempercayai saya untuk tidak menyalahgunakannya, Anda dapat memulai dengan cepat dengan @chaz: jackson.dev. Cukup tambahkan pengguna matriks itu ke kamar Anda, konfigurasikan dengan kunci API Anda sendiri ke backend yang kompatibel dengan API OpenAI, dan Anda siap melakukannya.
Chaz akan secara otomatis menerima undangan kamar untuk pengguna mana pun di allow_list .
Saat berada di sebuah ruangan, ia akan menyaksikan perintah yang diawali oleh !chaz . Jika itu DM, itu akan menanggapi setiap pesan yang tidak dikenali sebagai perintah. Jika ada di ruangan yang lebih besar, itu hanya akan menanggapi pesan yang dikirimkan padanya menggunakan !chaz .
Jadi di ruangan yang lebih besar, kirim hanya !chaz dan itu akan dikirim semua pesan terbaru di dalam ruangan dan meminta tanggapan. Anda juga dapat mengirim permintaan bersama dengan itu, mis !chaz explain that to me , dan itu akan menerima pesan Anda dan konteks ruangan dan merespons.
Perintah yang diakui adalah:
!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 Perintah !chaz role membutuhkan 0, 1, atau banyak argumen.
!chaz role untuk menunjukkan peran saat ini dan daftar semua peran yang tersedia.!chaz role <name> Untuk menetapkan peran yang ada sebagai default.!chaz role <name> <prompt> Untuk membuat peran baru dengan prompt yang diberikan. chaz hanya dikemas di Crates.io, tetapi disarankan agar Anda lari dari Git Head untuk saat ini.
Untuk pengguna NIX, repo ini berisi serpihan nix. Lihat bagian Pengaturan untuk detail tentang Mengkonfigurasi.
Ada gambar Docker yang tersedia di Docker Hub. Berikut contoh 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 :Perhatikan bahwa ini membutuhkan 2 file konfigurasi untuk dipasang ke dalam wadah, satu untuk Chaz dan satu untuk AICHAT. Anda juga harus mengatur direktori status/cache di file konfigurasi chaz Anda.
File konfigurasi chaz harus terlihat seperti ini:
homeserver_url : https://matrix.jackson.dev
username : " chaz "
password : " "
state_dir : " /state "
aichat_config_dir : " /aichat "
allow_list : " @.*:jackson.dev|@arcuru:matrix.org " Pertama, atur akun di server matriks apa pun untuk digunakan bot.
Buat file konfigurasi untuk bot dengan info loginnya.
PENTING : Pastikan Anda mengatur izin_list Anda atau bot tidak akan merespons
Default dikonfigurasi di 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. Untuk menjalankannya, sederhana:
chaz --config config.yaml .Bot tidak akan menanggapi pesan lama yang dikirim sementara itu tidak berjalan untuk mencegah backend yang membanjiri.
Pengembangan sedang dilakukan dengan menggunakan serpihan nix. Cara termudah untuk menginstal Chaz adalah dengan menggunakan Nix Flakes.
❯ nix run github:arcuru/chazSerpihan berisi overlay agar lebih mudah diimpor ke konfigurasi serpihan Anda sendiri. Untuk digunakan, tambahkan ke input Anda:
inputs . chaz . url = "github:arcuru/chaz" ; Dan kemudian tambahkan inputs.chaz.overlays.default overlay.chaz.overlays.default ke pkg Anda.
Serpihan juga berisi modul manajer rumah untuk menginstal Chaz sebagai layanan. Impor modul ke konfigurasi rumah-rumah Anda dan Anda dapat mengkonfigurasi chaz semua dari dalam nix:
{ 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" ;
} ;
} ;
} Dicerminkan di GitHub dan Codeberg. GitHub adalah repo resmi, tetapi gunakan salah satu repo untuk berkontribusi. Masalah tidak dapat disinkronkan sehingga mungkin ada beberapa duplikat.