loader image

Terminal GPT [Linux || MacOS]

What makes us different from other similar websites? Forums Tech Terminal GPT [Linux || MacOS]

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7145
    thumbtak
    Keymaster

    tgpt is a cross-platform command-line interface (CLI) tool that allows you to use AI chatbot in your Terminal without requiring API keys.

    Currently available providers:

    Image Generation Model: Craiyon V3

    Usage

    Usage: tgpt [Flags] [Prompt]

    Flags:
    -s, –shell Generate and Execute shell commands. (Experimental)
    -c, –code Generate Code. (Experimental)
    -q, –quiet Gives response back without loading animation
    -w, –whole Gives response back as a whole text
    -img, –image Generate images from text
    –provider Set Provider. Detailed information has been provided below (Env: AI_PROVIDER)

    Some additional options can be set. However not all options are supported by all providers. Not supported options will just be ignored.
    –model Set Model
    –key Set API Key
    –url Set OpenAI API endpoint url
    –temperature Set temperature
    –top_p Set top_p
    –max_length Set max response length

    Options:
    -v, –version Print version
    -h, –help Print help message
    -i, –interactive Start normal interactive mode
    -m, –multiline Start multi-line interactive mode
    -cl, –changelog See changelog of versions
    -u, –update Update program

    Providers:
    The default provider is phind. The AI_PROVIDER environment variable can be used to specify a different provider.
    Available providers to use: openai, opengpts, koboldai, phind, llama2, blackboxai, ollama and groq

    Provider: openai
    Needs API key to work and supports various models. Recognizes the OPENAI_API_KEY and OPENAI_MODEL environment variables.

    Provider: opengpts
    Uses gpt-3.5-turbo only. Do not use with sensitive data

    Provider: koboldai
    Uses koboldcpp/HF_SPACE_Tiefighter-13B only, answers from novels

    Provider: phind
    Uses Phind Model. Great for developers

    Provider: llama2
    Llama 2 is an open source large language model (LLM) developed by Meta AI. Uses llama2-70b by default. Supports other models.

    Provider: blackboxai
    Uses BlackBox model. Great for developers

    Provider: ollama
    Needs to be run locally. Supports many models

    Provider: groq
    Requires a free API Key. Supports LLaMA2-70b & Mixtral-8x7b

    Examples:
    tgpt “What is internet?”
    tgpt -m
    tgpt -s “How to update my system?”
    tgpt –provider opengpts “What is 1+1”
    tgpt –provider openai –key “sk-xxxx” –model “gpt-3.5-turbo” “What is 1+1”
    cat install.sh | tgpt “Explain the code”

    Installation

    Download for GNU/Linux 🐧 or MacOS 🍎

    The default download location is /usr/local/bin, but you can change it in the command to use a different location. However, make sure the location is added to your PATH environment variable for easy accessibility.

    You can download it with the following command:
    $ curl -sSL https://raw.githubusercontent.com/aandrew-me/tgpt/main/install | bash -s /usr/local/bin

    If you are using Arch Linux, you can install the AUR package with paru:

    $ paru -S tgpt-bin

    Or with yay:

    $ yay -S tgpt-bin

    Install with Go

    You need to add the Go install directory to your system’s shell path.

    $ go install github.com/aandrew-me/tgpt/v2@latest

    Updating ⬆️

    If you installed the program with the installation script, you may update it with

    $ tgpt -u

    It may require admin privileges.

    Proxy

    Support:

    Http Proxy [ http://ip:port ]
    Http Auth [ http://user:pass@ip:port ]
    Socks5 Proxy [ socks5://ip:port ]
    Socks5 Auth [ socks5://user:pass@ip:port ]

    If you want to use a proxy, create proxy.txt file in the same directory from where you are executing the file and write your proxy configuration there.

    Example:

    http://127.0.0.1:8080’

    From Release

    You can download the executable for your operating system, rename it to tgpt (or any other desired name), and then execute it by typing ./tgpt while in that directory. Alternatively, you can add it to your PATH environmental variable and then execute it by simply typing tgpt.

    Uninstalling

    If you installed with the install script, you can execute the following command to remove the tgpt executable

    $ sudo rm $(which tgpt)

    Configuration file is usually located in ~/.config/tgpt on GNU/Linux Systems and in "Library/Application Support/tgpt" on MacOS

    Source:
    https://github.com/aandrew-me/tgpt?tab=readme-ov-file#updating-%EF%B8%8F

    #7182
    thumbtak
    Keymaster

    Update:

    Full installation & Upgrade:

    $ pip install --upgrade "python-tgpt[all]"

    Full installation [Extras]:

    $ pip install --upgrade "python-tgpt[termux-all]"

    Usage:

    Quick Response:

    $ python -m pytgpt generate ""

    Interactive response:

    $ python -m pytgpt interactive ""

    More Info:

    https://pypi.org/project/python-tgpt/

    #7197
    thumbtak
    Keymaster

    If you are having issues with the above, like I was having in a VM of Linux, do the following …

    THIS IS ONLY AS A LAST OPTION AS IT IS NOT CONVENIENT.

    1. Ensure You Are Using a Virtual Environment

    First, create and activate a virtual environment to avoid issues with system-wide package installations.

    Create a Virtual Environment:

    $ python3 -m venv tgpt-env

    Activate the Virtual Environment:

    $ source tgpt-env/bin/activate

    2. Upgrade pip

    Ensure you have the latest version of pip, as older versions may have issues with some packages.

    Upgrade pip:

    $ pip install --upgrade pip

    3. Install the python-tgpt Package

    Try installing python-tgpt with all optional dependencies. If you encounter issues, you might want to check if python-tgpt supports extras directly in the installation command.

    Install python-tgpt:

    $ pip install --upgrade "python-tgpt[all]"

    Here is a script that will start Terminal GPT in an interactive environment (though a temp virtual environment), each time …

    #!/bin/bash
    python3 -m venv tgpt-env
    source tgpt-env/bin/activate
    pip install --upgrade pip
    pip install --upgrade "python-tgpt[all]"
    python -m pytgpt interactive ""

    Save the file as tgpt.sh and run the follow command, to execute the script …

    $ sudo bash tgpt.sh

    • This reply was modified 4 months, 2 weeks ago by thumbtak.
    • This reply was modified 4 months, 1 week ago by thumbtak. Reason: Script updated
    • This reply was modified 4 months, 1 week ago by thumbtak. Reason: Fixed the failed script
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
TAKs Shack