Code Monkey home page Code Monkey logo

tenere's Introduction

Tenere

A crab in the moroccan desert

TUI interface for LLMs written in Rust

๐Ÿ“ธ Demo

demo


๐Ÿ’Ž Supported LLMs

Only ChatGPT is supported for the moment. But I'm planning to support more models in the future.


๐Ÿ”Œ Installation

You can download the prebuilt binaries from the release page.

For MacOs users, you can use brew to install it as following:

brew tap pythops/tenere
brew install tenere

Otherwise, you can build from source. This requires Rust compiler and Cargo package manager.

Once Rust and Cargo are installed, run the following command to build:

cargo build --release

This will produce an executable file at target/release/tenere that you can copy to a directory in your $PATH.


โš™๏ธ Configuration

Tenere can be configured using a TOML configuration file. The file should be located in :

  • Linux : $HOME/.config/tenere/config.toml or $XDG_CONFIG_HOME/tenere/config.toml
  • Mac : $HOME/Library/Application Support/tenere/config.toml

General settings

Here are the available general settings:

  • archive_file_name: the file name where the chat will be saved. By default it is set to tenere.archive
  • model: the llm model name. Currently only chatgpt is supported.
archive_file_name = "tenere.archive"
model = "chatgpt"

Key bindings

Tenere supports customizable key bindings. You can modify some of the default key bindings by updating the [key_bindings] section in the configuration file. Here is an example with the default key bindings

[key_bindings]
show_help = '?'
show_history = 'h'
new_chat = 'n'
save_chat = 's'

Chatgpt

To use Tenere's chat functionality, you'll need to provide an API key for OpenAI. There are two ways to do this:

  1. Set an environment variable with your API key:
export OPENAI_API_KEY="YOUTR KEY HERE"
  1. Include your API key in the configuration file:
[chatgpt]
openai_api_key = "Your API key here"
model = "gpt-3.5-turbo"
url = "https://api.openai.com/v1/chat/completions"

The default model is set to gpt-3.5-turbo. check out the OpenAI documentation for more info.

๐Ÿš€ Usage

There are two modes like vim: Normal and Insert.

Insert mode

To enter Insert mode, You press i. Once you're in, you can use:

Esc: to switch back to Normal mode.

Enter: to create a new line

Backspace: to remove the previous character

Normal mode

When you launch tenere, it's in Normal mode by default. In this mode, you can use:

Enter: to submit the prompt

dd: to clear the prompt.

n: Start a new chat and save the previous one in history.

s: Save the current chat or chat history (history popup should be visible first) to tenere.archive file in the current directory.

Tab: to switch the focus.

j or Down arrow key: to scroll down

k or Up arrow key: to scroll up

h : Show chat history

q: to quit the app

?: to show the help pop-up. You can dismiss it with Esc


๐Ÿงญ Roadmap

  • Highlight the chat messages
  • Show the scroll bar
  • Support more models

๐Ÿ› ๏ธ Built with


๐Ÿ™ Acknowledgments

Big thanks to @orhun and @sophacles for their precious help ๐Ÿ™


โš–๏ธ License

AGPLv3

tenere's People

Contributors

pythops avatar nf1s avatar evangstav avatar orhun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.