{"id":22488644,"url":"https://github.com/arcuru/chaz","last_synced_at":"2025-12-30T09:48:32.646Z","repository":{"id":232024776,"uuid":"783278927","full_name":"arcuru/chaz","owner":"arcuru","description":"Chaz is an AI bot for Matrix","archived":false,"fork":false,"pushed_at":"2024-10-28T16:57:20.000Z","size":303,"stargazers_count":45,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-02T09:03:52.358Z","etag":null,"topics":["ai","chat","chatbot","llm","matrix"],"latest_commit_sha":null,"homepage":"https://chaz.is","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arcuru.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-07T12:56:54.000Z","updated_at":"2024-11-08T06:17:46.000Z","dependencies_parsed_at":"2024-04-13T15:47:17.672Z","dependency_job_id":null,"html_url":"https://github.com/arcuru/chaz","commit_stats":null,"previous_names":["arcuru/chaz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcuru%2Fchaz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcuru%2Fchaz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcuru%2Fchaz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcuru%2Fchaz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arcuru","download_url":"https://codeload.github.com/arcuru/chaz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228500219,"owners_count":17930019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chat","chatbot","llm","matrix"],"created_at":"2024-12-06T17:18:12.046Z","updated_at":"2025-12-30T09:48:32.640Z","avatar_url":"https://github.com/arcuru.png","language":"Rust","funding_links":[],"categories":["Bots","Rust"],"sub_categories":["Convenience"],"readme":"# chaz\n\n**IMPORTANT NOTICE** - This project is not very active. You should prefer to use https://github.com/etkecc/baibot, which is actively developed, with more features, and is supported by a company that runs Matrix servers.\n\nChaz is chaz.\n\nThis is a [Matrix](https://matrix.org) bot that connects to multiple LLM providers to allow for chatting with any of the LLM models. It is compatible with any model using the OpenAI API.\n\nIn addition, it is also possible to use [AIChat](https://github.com/sigoden/aichat) as a provider, so any models available through AIChat can be accessed as well.\n\nYou will need your own API keys or your own local AI already configured.\n\nAnnouncement Blog Post: [Chaz: An LLM \u003c-\u003e Matrix Chatbot](https://jackson.dev/post/chaz/)\n\n## Getting Help\n\nThere is a public Matrix room available at [#chaz:jackson.dev](https://matrix.to/#/#chaz:jackson.dev)\n\n## Getting Started\n\nIf you have your own API keys, and you trust me not to abuse them, you can get started quickly with [@chaz:jackson.dev](https://matrix.to/#/@chaz:jackson.dev).\nSimply add that Matrix user to your room, configure it with your own API keys to an OpenAI API compatible backend, and you're good to go.\n\n## Usage\n\nChaz will automatically accept Room invites for any user in the `allow_list`.\n\nWhen it's in a room, it will watch for commands that are prefixed by `!chaz`.\nIf it's a DM, it will respond to every message that it doesn't recognize as a command.\nIf it's in a larger room, it will only respond to messages that are sent to it using `!chaz`.\n\nSo in a larger room, send just `!chaz` and it will be sent all the recent messages in the room and asked for a response.\nYou can also send a request along with that, e.g. `!chaz explain that to me`, and it will receive your message and the context of the room and respond.\n\nThe commands that it recognizes are:\n\n```markdown\n!chaz help\n\nAvailable commands:\n!chaz print - Print the conversation\n!chaz send \u003cmessage\u003e - Send a message without context\n!chaz model \u003cmodel\u003e - Select the model to use\n!chaz backend \u003cname\u003e \u003capi_base\u003e \u003capi_key\u003e - Manually enter an OpenAI Compatible Backend\n!chaz role [\u003crole\u003e] [\u003cprompt\u003e] - Get the role info, set the role, or define a new role\n!chaz list - List available models\n!chaz clear - Ignore all messages before this point\n!chaz rename - Rename the room and set the topic based on the chat content\n!chaz help - Show this message\n```\n\n### Setting Roles\n\nThe `!chaz role` command takes 0, 1, or many arguments.\n\n- Use `!chaz role` to show the current role and list all available roles.\n- Use `!chaz role \u003cname\u003e` to set an existing role as the default.\n- Use `!chaz role \u003cname\u003e \u003cprompt\u003e` to create a new role with the given prompt.\n\n## Install\n\n`chaz` is only packaged on crates.io, but it's recommended that you run from git HEAD for now.\n\nFor [Nix](https://nixos.org/) users, this repo contains a Nix flake. See the [setup section](#nix) for details on configuring.\n\n### Docker\n\nThere is a docker image available on [Docker Hub](https://hub.docker.com/r/arcuru/chaz).\nHere's a Docker Compose example:\n\n```yaml\nservices:\n  chaz:\n    image: arcuru/chaz:main # Set to your desired version\n    restart: unless-stopped\n    network_mode: host\n    volumes:\n      # Mount your config file to /config.yaml\n      - ./config.yaml:/config.yaml\n      # Mount your aichat config to /aichat, AND SET THAT LOCATION IN CHAZ'S CONFIG.YAML\n      - aichat-state:/aichat\n      - ./aichat.yaml:/aichat/config.yaml\n      # Mount the volume into the same location specified in config.yaml\n      - chaz-state:/state\n    logging:\n      driver: \"json-file\"\n      options:\n        max-size: \"1m\"\n        max-file: \"1\"\n\nvolumes:\n  # Persists the logged in session\n  chaz-state:\n  aichat-state:\n```\n\nNote that this requires 2 config files to be mounted into the container, one for chaz and one for aichat.\nYou'll also need to set the state/cache directories in your chaz config file.\n\nThe chaz config file should look something like this:\n\n```yaml\nhomeserver_url: https://matrix.jackson.dev\nusername: \"chaz\"\npassword: \"\"\nstate_dir: \"/state\"\naichat_config_dir: \"/aichat\"\nallow_list: \"@.*:jackson.dev|@arcuru:matrix.org\"\n```\n\n## Setup\n\nFirst, setup an account on any Matrix server for the bot to use.\n\nCreate a config file for the bot with its login info.\n\n**IMPORTANT**: Make sure that you setup your allow_list or the bot will not respond\n\nThe defaults are configured in [src/defaults.rs](src/defaults.rs)\n\n```yaml\nhomeserver_url: https://matrix.org\nusername: \"chaz\"\npassword: \"\" # Optional, if not given it will ask for it on first run\nallow_list: \"\" # Regex for allowed accounts.\n#message_limit: 0 # Set a per-account message limit, it will not allow more than this many messages per account.\n#room_size_limit: 0 # Set a room size limit. It will refuse join if the room is too large.\nstate_dir: \"$XDG_STATE_HOME/chaz\" # Optional, for setting the chaz state directory\naichat_config_dir: \"$AICHAT_CONFIG_DIR\" # Optional, for using a separate aichat config\nchat_summary_model: \"\" # Optional, set a different model than the default to use for summarizing the chat\ndisable_media_context: false # Optional, set to true to disable sending media context to aichat\nrole: chaz # Optionally set a role, AKA system prompt. Set to `chaz` for the full chaz experience, or `cave-chaz` for even more chaz\n# Define backends. If more than 1 is defined, model names will be prefixed by the backends name.\n# If none are defined, Chaz will look for Aichat\nbackends:\n  - name: openai # Name of the backend, models will be shown with this as a prefix, e.g. openai:gpt-4\n    type: openaicompatible\n    api_key:\n    api_base: https://api.openai.com/v1\n    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 ....'\n      - name: gpt-4o\n      - name: gpt-4o-mini\n  - name: tog # Name can be anything. Model names will be \"tog:\u003cmodel\u003e\"\n    type: openaicompatible\n    api_key:\n    api_base: https://api.together.xyz/v1\n  - name: aic\n    type: aichat\nroles: # Optional, define your own roles\n  - name: chaz # This one is predefined\n    description: Chaz is Chaz\n    prompt: \"Your name is Chaz, you are an AI assistant, and you refer to yourself in the third person.\"\n    example: # Optionally define example messages.\n      - user: User\n        message: \"Are you ready?\"\n      - user: Assistant\n        message: \"Chaz is ready.\"\n  - name: bash\n    description: Get a single shell command\n    prompt: \u003e\n      Based on the following user description, generate a corresponding Bash shell command.\n      Focus solely on interpreting the requirements and translating them into a single, executable Bash command.\n      Ensure accuracy and relevance to the user's description.\n      The output should be a valid Bash command that directly aligns with the user's intent, ready for execution in a command-line environment.\n      Do not output anything except for the command.\n      No code block, no English explanation, no newlines, and no start/end tags.\n```\n\n## Running\n\nTo run it, simply:\n\n1. Install _chaz_ and setup its config.\n2. Install [AIChat](https://github.com/sigoden/aichat).\n3. Configure [AIChat](https://github.com/sigoden/aichat) with the models and defaults that you want.\n4. Create a config file for _chaz_ with login details.\n5. Run the bot and specify it's config file location `chaz --config config.yaml`.\n\nThe bot will not respond to older messages sent while it wasn't running to prevent overwhelming the backend.\n\n## Nix\n\nDevelopment is being done using a [Nix flake](https://nixos.wiki/wiki/Flakes).\nThe easiest way to install chaz is to use nix flakes.\n\n```bash\n❯ nix run github:arcuru/chaz\n```\n\nThe flake contains an [overlay](https://nixos.wiki/wiki/Overlays) to make it easier to import into your own flake config.\nTo use, add it to your inputs:\n\n```nix\n    inputs.chaz.url = \"github:arcuru/chaz\";\n```\n\nAnd then add the overlay `inputs.chaz.overlays.default` to your pkgs.\n\nThe flake also contains a home-manager module for installing chaz as a service.\nImport the module into your home-manager config and you can configure `chaz` all from within nix:\n\n```nix\n{inputs, ... }: {\n  imports = [ inputs.chaz.homeManagerModules.default ];\n  services.chaz = {\n    enable = true;\n    settings = {\n        homeserver_url = \"https://matrix.jackson.dev\";\n        username = \"chaz\";\n        password = \"hunter2\";\n        allow_list = \"@me:matrix.org|@myfriend:matrix.org\";\n    };\n  };\n}\n```\n\n## Repository\n\n**Mirrored on [GitHub](https://github.com/arcuru/chaz) and [Codeberg](https://codeberg.org/arcuru/chaz). GitHub is the official repo, but use either repo to contribute. Issues can't be synced so there may be some duplicates.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcuru%2Fchaz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farcuru%2Fchaz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcuru%2Fchaz/lists"}