cool Vibe coding with Jan, an open source AI

Jan serves as a ChatGPT alternative that runs entirely offline on your desktop.

Are you looking for a locally hosted, open-source GPT that prioritizes your privacy and allows you to use the latest AI models? If so, you need to download Jan. It is easy to install on Linux, macOS, and Windows, and it comes with excellent documentation to guide you through the process.

Jan serves as a ChatGPT alternative that runs entirely offline on your desktop. Its goal is to empower anyone—regardless of coding expertise—to download and use AI models with complete control and privacy. Jan operates under a fully open-source model with an Apache 2.0 license. It stores all data locally, making internet access optional since it can function entirely offline. Users have the flexibility to choose AI models, whether they are local or cloud-based, without the concern of data being sold.

Jan is powered by Llama.cpp, a local AI engine that offers an OpenAI-compatible API, enabling you to utilize AI capabilities across various applications on your laptop or PC.

Getting started with Jan

I downloaded and installed Jan on Linux Mint 22.1 using the deb package file. If you are using a non-Debian-based Linux distribution like Fedora, you can install the app image file instead. I also successfully downloaded and installed Jan on my M3 MacBook Air. The project's documentation is excellent and makes it easy to get started with Jan, so be sure to consult it.

Jan comes with the jan-nano-128k-Q4_K_M model as part of the initial installation. This means you can start using Jan without downloading any additional models, and all your data remains on your machine in the ~/.local/share/Jan/data folder. There are dozens of additional models that can be downloaded and installed. You can also obtain an API from HuggingFace, OpenAI, Anthropic, Mistral, and others to run their models too.

When you first launch Jan, you will be greeted by the following display. You can see that the model is inviting you to interact with it. You can start there with a simple request, such as writing a letter to apply to a particular university, asking to be admitted to their computer science department. At the lower left is a menu where you can begin a 'New Chat', next to that is a section where you can create 'Assitants' that can perform custom AI operations of your description. The 'Hub' is where you can find dozens of other models that can be downloaded. 'Settings' allows you to change the appearance of the application, the location of the data folder, switch to enable experimental features, and control privacy and other features.

Welcome to Jan

A vibe coding experiment

I asked Jan: Create a Python web app to collect customer information for the Eversweet Ice Cream stand. Collect first name, last name, address, city, state, zip and phone number. Store the data in a csv file. I needed to create a virtual environment with Python for the application to work and I did this by creating a directory which I called 'Hall.' Within that directory, I created the virtual environment with the following commands:

$ python3 -m venv /home/don/Hall

Then I activated the virtual environment:

$ source venv/bin/activate

The directions provided by Jan requested me to install the Flask module.

$ pip3 install Flask

Then I opened VSCodium and copied the code provided by Jan to create the Python file. It took Jan a little less than a minute to start to provide the code and directions. I copied the code into the VSCodium editor and saved it as directed to 'app.py'

from flask import Flask, render_template, request, redirect, url_for
import csv

app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/submit', methods=['POST'])
def submit():
    # Get form data
    first_name = request.form['first_name']
    last_name = request.form['last_name']
    address = request.form['address']
    city = request.form['city']
    state = request.form['state']
    zip_code = request.form['zip_code']
    phone = request.form['phone']

    # Store data in a CSV file
    with open('customers.csv', 'a', newline='') as csvfile:
        fieldnames = ['First Name', 'Last Name', 'Address', 'City', 'State', 'Zip Code', 'Phone']
        writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
        writer.writerow({'First Name': first_name, 'Last Name': last_name, 'Address': address, 'City': city, 'State': state, 'Zip Code': zip_code, 'Phone': phone})

    return redirect(url_for('index'))

if __name__ == '__main__':
    app.run(debug=True)

Jan provided the code for an HTML file which it directed me to put in a directory called 'templates' which is within the 'Hall' directory. Here's that code.

<!DOCTYPE html>
<html>
<head>
    <title>Eversweet Ice Cream - Customer Info</title>
</head>
<body>
    <h1>Register Customer</h1>
    <form action="/submit" method="post">
        <label>First Name:</label>
        <input type="text" name="first_name" required><br><br>
        
        <label>Last Name:</label>
        <input type="text" name="last_name" required><br><br>
        
        <label>Address:</label>
        <input type="text" name="address" required><br><br>
        
        <label>City:</label>
        <input type="text" name="city" required><br><br>
        
        <label>State:</label>
        <input type="text" name="state" required><br><br>
        
        <label>Zip Code:</label>
        <input type="text" name="zip_code" required><br><br>
        
        <label>Phone Number:</label>
        <input type="text" name="phone" required><br><br>
        
        <input type="submit" value="Submit">
    </form>
</body>
</html>

Let's try it

Jan directed me to run the app which I did with the following command:

$ python3 app.py

Running the Python app

I was directed to open a web browser and go to http://127.0.0.1:5000. You will see the registration form. Fill in the customer information and submit it. The data will be stored in a CSV file named customers.csv in the same directory as the app.py file. I opened Firefox to http://127.0.0.1:5000 and was presented with the following web app to collect customer information for the Ice Cream store.

Entering customer information

I clicked on the 'Submit' button and checked in the project directory and there was a newly created CSV file with the information provided from the web app. I entered more customer data into the web form and it was appended to the CSV file. You can expand the app by adding more features like a database.