DEV Community

Roy J. Wignarajah
Roy J. Wignarajah

Posted on • Updated on

More Adventures in Open Source Development - ChatCraft

More Open Source

In my final semester, I'm taking another Open Source class. If you've read my blog posts from 2023, you'd have seen my journey in learning open source and contributing to various open source projects. This semester, I'll be doing something different. Instead of contributing to various projects, I'll be using the skills I learned to contribute to one project.

On ChatGPT

Many readers are already aware of ChatGPT by OpenAI, and have probably used ChatGPT for various purposes. If you've used it for programming help, you may have noticed the responses ChatGPT gives are a little inaccurate not exactly what you ask for. You may have experienced rate limits or have been signed out and force to log back in to use ChatGPT. In my Open Source class, I will be contributing to ChatCraft.org, an alternative to ChatGPT.

ChatCraft - An AI Chatbot for Developers

Inception

tarasglek/chatcraft.org is an open-source, developer-oriented ChatGPT frontend for coding with Large Language Models (LLMs). ChatCraft was started because the author, Taras, experienced the same issues I (and perhaps those reading) have also noticed with ChatGPT (workflow disruptions due to service downtime, having to re-login). The beauty of ChatCraft is that you don't need to login, just paste your API key and you can get started. He also wanted to interactively edit mermaid diagrams using GPT, which can't be easily done using ChatGPT or other open soure ChatGPT frontends. More information is available on Taras' blog.

My instructor, David Humphrey, has worked with Taras to rebuild ChatCraft's UI/UX, which now has a look inspired by GitHub and should bring a familiar experience to developers. You can find David's blog on ChatCraft over here.

Neat Features

My instructor demonstrated ChatCraft to our class, and I'm already impressed with what I've seen. ChatCraft has some neat features that might interest you:

  • Customizable System Prompts
  • Multi-vendor Support
  • Browser-based
  • GitHub-inspired User Interface
  • Shareable Chats
  • Cost-effective (pay for what you use, no subscription fees)

Installation

For this week, my task was setting up my development environment and getting access to Secrets using sops. To setup my development environment I followed the instructions in the CONTRIBUTING.md. I found the installation instructions easy to follow, and they worked for my Windows 10 machine.

Managing Secrets using sops.

ChatCraft uses sops for secrets management. Being able to access secrets requires uploading a public ssh-ed25519 key to GitHub and getting your GitHub username to a YAML file.

Instructions for this setup are found in the README.sops.md file. Following the instructions, I installed the following:

I'm still learning about sops and ssh-to-age. So far, the only things I know about sops is that it's an acronym for "Secrets OPerationS" and that it's used to handle sensitive data like API keys. As for ssh-to-age, it's a tool that converts SSH Ed25519 keys to another type of key called age keys.

Generating SSH Keys

While I had no trouble installing and setting up ChatCraft, generating SSH keys was a new concept. I found the following GitHub Docs helpful:

  1. Adding a new SSH key to your GitHub account
  2. Checking for existing SSH keys
  3. Generating a new SSH key and adding it to the ssh-agent

I advise reading #1 first, and then referring to #2 and #3 when instructed to within #1.

Course and Project Goals

ChatCraft is an amazing project and I'm grateful for the opportunity to contribute to its development this semester. However, I'm nervous about how much I'll actually be able to contribute. Much of the codebase is in TypeScript, which I'm not too comfortable writing in. I'm planning to do some code reading over the next couple weeks to become familiar with ChatCraft and to get a feel for coding style used. For now, I think I'd be interested in contributing to automation and CI/CD workflows. I'd also like to try adding support for languages using WASM. I don't know too much about WASM, but I'm hoping to learn it this semester and to implement it in ChatCraft.

Next Steps

Over the next few months, I'll be posting weekly updates on my journey and progress in contributing to ChatCraft. I'm very nervous and have a lot to learn, but I hope with each update my skills improve and I'll have some cool things to share with you. I'm excited to see what these next months will bring.

Top comments (0)