Skip to main content

An AI-powered chatbot for the terminal and editor

Project description

Lovelaice: An AI-powered assistant for your terminal and editor

Lovelaice is an LLM-powered bot that sits in your terminal. It has access to your files and it can run bash commands for you. It can also access the Internet and search for answers to general questions, as well as technical ones.

Installation

Install with pip:

pip install lovelaice

Ussage

Before using Lovelaice, you will need an API key for Mistral.

export MISTRAL_API_KEY="..."

You can use lovelaice from the command line to ask something causal like:

$ lovelaice what is the meaning of life

The meaning of life is a philosophical and metaphysical question
related to the significance of living or existence in general.
Many different people, cultures, and religions have different
beliefs about the purpose and meaning of life.

[...]

You can also ask lovelaice to do something in your terminal:

$ lovelaice how much free space do i have
:: Using Bash

Running the following code:
$ df -h | grep '/$' | awk '{ print $4 }'
[y]es / [N]o y

5,5G

You have approximately 5.5 Gigabytes of free space left on your filesystem.

And if you ask it something math-related it can run Python for you:

$ lovelaice throw three d20 dices and return the middle value
:: Using Python

Will run the following code:

def solve():
    values = [random.randint(1, 20) for _ in range(3)]
    values.sort()
    return values[1]

result = solve()

[y]es / [N]o y

Result: 14

NOTE: Lovelaice will always require you to explicitly agree to run any code. Make sure that you understand what the code will do, otherwise there is no guarantee your computer won't suddenly grow a hand and slap you in the face, like, literally.

You can also use Lovelaice in interactive mode just by typing lovelaice without a query. It will launch a conversation loop that you can close at any time with Ctrl+C.

Features

So far Lovelaice has both general-purpose chat capabilites, and access to bash. Here is a list of things you can try:

  • Chat with Lovelaice about casual stuff
  • Ask Lovelaice questions about your system, distribution, free space, etc.
  • Order Lovelaice to create folders, install packages, update apps, etc.
  • Order Lovelaice to set settings, turn off the wifi, restart the computer, etc.
  • Order Lovelaice to stage, commit, push, show diffs, etc.
  • Ask Lovelaice to solve some math equation, generate random numbers, etc.

In general, you can attempt to ask Lovelaice to do just about anything that requires bash, and it will try its best. Your imagination is the only limit.

Here are some features under active development:

  • Generate and run Python code.
  • Search in Google, crawl webpages, and answer questions using that content.
  • Read files and answer questions about their content.
  • Create and modify notes, emails, calendar entries, etc.

Contributing

Code is MIT. Just fork, clone, edit, and open a PR.

FAQ

What models do you use?

Currently, only Mistral models are integrated, but you are welcome to submit PRs to add other LLM providers, such as OpenAI.

Is this safe?

Lovelaice will never run code without your explicit consent. That being said, LLMs are known for making subtle mistakes, so never trust that the code does what Lovelaice says it do. Always read the code and make sure you understand what it does.

When in doubt, adopt the same stance as if you were copy/pasting code from a random blog somehwere in the web (because that is exactly what you're doing).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lovelaice-0.1.9.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lovelaice-0.1.9-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file lovelaice-0.1.9.tar.gz.

File metadata

  • Download URL: lovelaice-0.1.9.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.6 Linux/5.15.0-43-generic

File hashes

Hashes for lovelaice-0.1.9.tar.gz
Algorithm Hash digest
SHA256 ae228b3f7baa017bf94afe8b191ac1daa411a0262a3db35c45441ea9242ceae1
MD5 6c6d37490189faa25dceb902bc911f69
BLAKE2b-256 47728593afc1216bc64d71121e0338c4f3f9601ac46e11b5e4f50edcf1a89bb7

See more details on using hashes here.

File details

Details for the file lovelaice-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: lovelaice-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.6 Linux/5.15.0-43-generic

File hashes

Hashes for lovelaice-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc5d36ed8f70ad61a682470fd1d6818fb564ed0b55756d7e8139e2efae47c8f
MD5 0f59419439a137102e2f0d31137ca6b9
BLAKE2b-256 303e9263158f26e85894588b35aa73c73759fc17cabb55f48210630dc472180a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page