Back to articles
Install ShellGPT with Gemini API

Install ShellGPT with Gemini API

via Dev.toAnand Vikkath

1. Install System Dependencies Ensure your Ubuntu system is ready with Python and the required virtual environment tools. sudo apt update sudo apt install python3 python3-pip python3-venv -y 2. Set Up a Virtual Environment Installing in a virtual environment prevents ShellGPT from interfering with other system tools. # Create and enter the directory mkdir ~/shellgpt && cd ~/shellgpt # Create the environment python3 -m venv venv # Activate it (you must do this every time you work in this folder) source venv/bin/activate 3. Install ShellGPT with LiteLLM ShellGPT needs the litellm extra to talk to Google's API. pip install "shell-gpt[litellm]" 4. Configure Your API Keys ShellGPT has a quirk: it was built for OpenAI, so it crashes if it doesn't find an OpenAI key, even if you are using Gemini. We bypass this by giving it a "placeholder" key. Set the environment variables Add these to your .bashrc so they load automatically when you log in: echo 'export GEMINI_API_KEY="your_actual_ai_api_ke

Continue reading on Dev.to

Opens in a new tab

Read Full Article
3 views

Related Articles