Metadata-Version: 2.1
Name: nollama
Version: 0.2.0
Summary: A terminal-based interface for interacting with large language models (LLMs)
Home-page: https://github.com/spignelon/nollama
Author: Ujjawal Saini
Author-email: spignelon@proton.me
License: GPL-3.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohappyeyeballs==2.4.0
Requires-Dist: aiohttp==3.10.5
Requires-Dist: aiohttp-socks==0.9.0
Requires-Dist: aiosignal==1.3.1
Requires-Dist: altgraph==0.17.4
Requires-Dist: annotated-types==0.7.0
Requires-Dist: anyio==4.4.0
Requires-Dist: async-timeout==4.0.3
Requires-Dist: attrs==24.2.0
Requires-Dist: beautifulsoup4==4.12.3
Requires-Dist: blessed==1.20.0
Requires-Dist: blinker==1.8.2
Requires-Dist: bottle==0.12.25
Requires-Dist: brotli==1.1.0
Requires-Dist: browser-cookie3==0.19.1
Requires-Dist: cairocffi==1.7.1
Requires-Dist: cairosvg==2.7.1
Requires-Dist: certifi==2024.7.4
Requires-Dist: cffi==1.17.0
Requires-Dist: charset-normalizer==3.3.2
Requires-Dist: click==8.1.7
Requires-Dist: cloudscraper==1.2.71
Requires-Dist: cryptography==43.0.0
Requires-Dist: cssselect2==0.7.0
Requires-Dist: curl-cffi==0.7.1
Requires-Dist: defusedxml==0.7.1
Requires-Dist: duckduckgo-search==6.2.10
Requires-Dist: editor==1.6.6
Requires-Dist: fastapi==0.112.1
Requires-Dist: flask==3.0.3
Requires-Dist: frozenlist==1.4.1
Requires-Dist: g4f==0.3.3.3
Requires-Dist: h11==0.14.0
Requires-Dist: idna==3.7
Requires-Dist: inquirer==3.4.0
Requires-Dist: itsdangerous==2.2.0
Requires-Dist: jeepney==0.8.0
Requires-Dist: jinja2==3.1.4
Requires-Dist: loguru==0.7.2
Requires-Dist: lz4==4.3.3
Requires-Dist: markdown-it-py==3.0.0
Requires-Dist: markupsafe==2.1.5
Requires-Dist: mdurl==0.1.2
Requires-Dist: multidict==6.0.5
Requires-Dist: nest-asyncio==1.6.0
Requires-Dist: packaging==24.1
Requires-Dist: pillow==10.4.0
Requires-Dist: platformdirs==4.2.2
Requires-Dist: plyer==2.1.0
Requires-Dist: primp==0.6.1
Requires-Dist: proxy-tools==0.1.0
Requires-Dist: pycparser==2.22
Requires-Dist: pycryptodome==3.20.0
Requires-Dist: pycryptodomex==3.20.0
Requires-Dist: pydantic==2.8.2
Requires-Dist: pydantic-core==2.20.1
Requires-Dist: pyexecjs==1.5.1
Requires-Dist: pygments==2.18.0
Requires-Dist: pyinstaller==6.10.0
Requires-Dist: pyinstaller-hooks-contrib==2024.8
Requires-Dist: pyparsing==3.2.0
Requires-Dist: python-socks[asyncio]==2.5.1
Requires-Dist: pywebview==5.2
Requires-Dist: readchar==4.2.0
Requires-Dist: requests==2.32.3
Requires-Dist: requests-toolbelt==1.0.0
Requires-Dist: rich==13.7.1
Requires-Dist: runs==1.2.2
Requires-Dist: six==1.16.0
Requires-Dist: sniffio==1.3.1
Requires-Dist: soupsieve==2.6
Requires-Dist: starlette==0.38.2
Requires-Dist: termcolor==2.3.0
Requires-Dist: tinycss2==1.3.0
Requires-Dist: typing-extensions==4.12.2
Requires-Dist: urllib3==2.2.2
Requires-Dist: uvicorn==0.30.6
Requires-Dist: wcwidth==0.2.13
Requires-Dist: webencodings==0.5.1
Requires-Dist: werkzeug==3.0.4
Requires-Dist: xmod==1.8.1
Requires-Dist: yarl==1.9.4
Requires-Dist: yaspin==3.0.2

# NoLlama

NoLlama is a terminal-based interface for interacting with large language models (LLMs) that you can't run locally on your laptop. Inspired by [Ollama](https://ollama.com/), NoLlama provides a streamlined experience for chatting with models like GPT-4o, GPT-4o-mini, Claude 3 haiku, Mixtral, LLaMA 70B, and more, directly from your terminal.

While Ollama offers a neat interface for running local LLMs, their performance and capabilities often fall short of these massive models. NoLlama bridges this gap by allowing you to interact with these powerful models using a lightweight terminal UI, complete with colorful markdown rendering, multiple model choices, and efficient memory usage.

![NoLlama](https://i.imgur.com/Py1qESW.png)

## Features

- **Multiple Model Choices:** Switch between various LLMs like GPT-4o, GPT-4o-mini, Mixtral, LLaMA 70B, Claude 3 haiku and more.
- **Neat Terminal UI:** Enjoy a clean and intuitive interface for your interactions.
- **Colorful Markdown Rendering:** Unlike Ollama, NoLlama supports rich text formatting in markdown.
- **Low Memory Usage:** Efficient memory management makes it lightweight compared to using a browser for similar tasks.
- **Easy Model Switching:** Simply type `model` in the chat to switch between models.
- **Clear Chat History:** Type `clear` to clear the chat history.
- **Exit Prompt:** Type `q`, `quit`, or `exit` to leave the chat.
- **Default Mode:** NoLlama runs in standard mode by default—just type `nollama` in the terminal to start.
- **Experimental Feature:** Enable live streaming of output with the `--stream` flag (unstable).
- **Anonymous and Private Usage:** Use `torsocks` to route all traffic through the Tor network for privacy.

## Installation

1. **Download the Binary:**

    Download the latest binary from the [Releases](https://github.com/spignelon/nollama/releases) page.

2. **Move the Binary to `/usr/bin/`:**

    After downloading, move the binary to `/usr/bin/` for easy access from anywhere in your terminal:

    ```bash
    sudo mv nollama /usr/bin/
    ```

3. **Run NoLlama:**

    Start NoLlama from the terminal by simply typing:

    ```bash
    nollama
    ```

    This will start NoLlama in the default mode.

## Building from Source

If you'd like to build NoLlama from source, follow these steps:

1. **Clone the Repository:**

    ```bash
    git clone https://github.com/spignelon/nollama.git
    cd nollama
    ```

2. **Install Dependencies:**

    You can install the required dependencies using `pip`:
    Creating a python virtual environment:
    ```bash
    virtualenv .venv
    source .venv/bin/activate
    ```

    ```bash
    pip install -r requirements.txt
    ```

3. **Compile the Script (Optional):**

    If you want to compile the script into a standalone executable, you can use PyInstaller:

    First set `version_check: bool = False` in `.venv/lib/python3.12/site-packages/g4f/debug.py`

    Then:
    ```bash
    pyinstaller --onefile --name=nollama --collect-all readchar nollama.py
    ```

4. **Move the Executable to `/usr/bin/`:**

    After compilation, move the binary to `/usr/bin/`:

    ```bash
    sudo mv dist/nollama /usr/bin/nollama
    ```

5. **Run NoLlama:**

    Start NoLlama by typing:

    ```bash
    nollama
    ```

## Usage

- **Switch Models:** Type `model` in the chat to choose a different LLM.
- **Clear Chat:** Type `clear` to clear the chat history.
- **Exit:** Type `q`, `quit`, or `exit` to leave the chat.
- **Default Mode:** Run NoLlama without any flags for standard operation:

    ```bash
    nollama
    ```

## Anonymous and Private Usage

For enhanced privacy and anonymity, you can use `torsocks` to route NoLlama's traffic through the Tor network. This ensures that all requests are anonymized and cannot be traced back to you.

### Step 1: Install Tor

#### Debian/Ubuntu:

```bash
sudo apt update
sudo apt install tor
```

#### Arch Linux:

```bash
sudo pacman -S tor
```

#### Fedora:

```bash
sudo dnf install tor
```

### Step 2: Enable and Start Tor

After installation, you need to enable and start the Tor service:

```bash
sudo systemctl enable tor
sudo systemctl start tor
```

### Step 3: Run NoLlama with Tor

Once Tor is running, you can use `torsocks` to run NoLlama anonymously:

```bash
torsocks nollama
```

This will ensure that all your interactions with NoLlama are routed through the Tor network, providing a layer of privacy and anonymity.

## Experimental Feature

- **Streaming Mode:**

    NoLlama includes an experimental streaming mode that allows you to see responses as they are generated. This mode is currently unstable and may cause issues. To enable streaming, use the `--stream` flag:

    ```bash
    nollama --stream
    ```

## Contribution

Contributions are welcome! If you have suggestions for new features or improvements, feel free to open an issue or submit a pull request.

## Acknowledgments

- **[g4f](https://pypi.org/project/g4f/):** Used for connecting to various LLMs.
- **[Python Rich](https://pypi.org/project/rich/):** Used for colorful markdown rendering and improved terminal UI.

## Disclaimer

NoLlama is not affiliated with Ollama. It is an independent project inspired by the concept of providing a neat terminal interface for interacting with language models, particularly those that are too large to run locally on typical consumer hardware or not available for self hosting.

## License

This project is licensed under the [GPL-3.0 License](LICENSE). <br>
[![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](https://www.gnu.org/licenses/gpl-3.0.en.html)
