# oxpilot
**Repository Path**: mrlijing/oxpilot
## Basic Information
- **Project Name**: oxpilot
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-02-08
- **Last Updated**: 2025-02-08
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# `oxpilot` - rusty AI copilot
`oxpilot` is a CLI powered by LLM[^1] written in Rust 🦀. It's built on top of [candle](https://github.com/huggingface/candle), with aims to be minimalist, fast, and accessible (in terms of computing resource).
## Install
### Mac
Install using `brew`
```sh
brew install chenhunghan/homebrew-formulae/oxpilot
```
Upgrade to the latest
```sh
brew update
brew upgrade oxpilot
```
### Linux and Windows
Go to [releases](https://github.com/chenhunghan/oxpilot/releases) for binaries.
## Commands
### Chat
Who doesn't want to chat with AI?
```sh
ox hi in Japanese
```
### **_AI_** Commmit with LLM
I am very lazy at drafting a comprehensive commit message, why not make LLM genereate one for me according to `git diff`? Don't worry, `ox` will ask your confirmation before commit the changes/messages.
```sh
git add .
ox commit # proxy to `git commit` with generated message
```

It will try to generate a commit message following [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec, however, LLM isn't perfect and you can always edit before commit.
Fun fact: most of commits in this repo are generated by `ox` itself.
### Start the copilot server
Start a Github copilot-compatible server, see the [this](https://dev.to/chenhunghan/use-code-llama-and-other-open-llms-as-drop-in-replacement-for-copilot-code-completion-58hg) on how to configure the Copilot extensions in your editor to pointing to the copilot-compatible server.
```sh
ox serve
```
## Goal of this project
The primary goal of this project is to teach (myself, and everyone else) idiomatic Rust, similar to [mini-redis](https://github.com/tokio-rs/mini-redis), therefore the code is overly heavily documented, there is an article introducing the core concepts [I made a Copilot in Rust 🦀 , here is what I have learned](https://dev.to/chenhunghan/i-made-a-copilot-in-rust-here-is-what-i-have-learned-as-a-typescript-dev-52md), I recommend to read first, and [PRs description](https://github.com/chenhunghan/oxpilot/pulls?q=is%3Apr) are packed with design patterns used in the code base.
- [Introduction](https://dev.to/chenhunghan/i-made-a-copilot-in-rust-here-is-what-i-have-learned-as-a-typescript-dev-52md)
- Design Patterns
- [Builder and `impl Into`](https://github.com/chenhunghan/oxpilot/pull/1)
- [Type State: Friendly API for Better DX](https://github.com/chenhunghan/oxpilot/pull/5)
- [BDD `POST /v1/engines/:engine/completions`](https://github.com/chenhunghan/oxpilot/pull/6)
## Release
```
git commit -am "release: version 0.1.0" --allow-empty
git push
git tag v0.1.0
git push --tags # will then trigger CI
```
[^1]: Currently [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)