This page is a list of AI solutions that you can use via API for a fee
Author: Yazeed
Anthropic / Claude
Anthropic’s claude is probably the main competing AI to OpenAI’s ChatGPT
Anthropic has an edge over OpenAI in many areas, I personally think it is better than OpenAI for Code generation
To simply chat with Claude, you can create an account at https://claude.ai/
To obtain API keys from anthropic and access the system programmatically, you will need to get the API keys from https://console.anthropic.com/
Your .env file
In the context of my AI notes, here is what you need to know about the .env file
Any file that starts with a . is a hidden file according to linux, windows is a bot funny about such files, it allows their existance, as long as you don’t try to use windows explorer to name or rename into them.
On linux, if you want the ls command to show such files, you would execute the command “ls -a
“
Now, with that out of the way, let me start with a few variables for various providers
# Open AI (ChatGPT)
OPENAI_API_KEY=sk-proj-xxxx
# Google AI (Gemeni)
GOOGLE_API_KEY=xxxx
# Anthropic (Claude)
ANTHROPIC_API_KEY=xxxx
# Huging face (HF_TOKEN is short for hugging face token)
HF_TOKEN=xxxx
e1000e detected hardware unit hang
ethtool -K eno1 gso off gro off tso off
To check the state
ethtool –k eno1 | grep tcp
OpenAI – ChatGPT
I am not sure this requires any introduction !
While the ChatGPT app can be accessed through, the API portal is at platform.openai.com, and even though the website provides a free tier, the API does not, you must have prepaid credits in order to use it, the minimum is $5, those $5 are pay as you go, you use them up by sending more API calls.
GPT 4o is rumored to be 10 Trillion parameters !! for comparison, deepseek, which is an amazing LLM that came out lately is 671 Billion parameters, meaning it is 7% of the size of ChatGPT !
Models and API pricing
Python virtual environment with pip
If you are familiar with python, you probably are also familiar with pip, and very likely familiar with venv (Virtual environments)
There is nothing special in particular about this for AI, it is exactly as you would for an odoo installation for example
For AI, i would totally recommend anaconda, but if for some reason that is not an option, this option will do 100% of the time
So, you need to start by installing Python 3 !, On debian, I would just use the repository with apt, it may be true at the time of writing that in the repo it uses 3.11 rather than the latest 3.13, but that is absolutely fine
sudo apt update
// The following command should dosudo apt install python3
//But i would much rather install everything python in one go
apt install build-essential wget git python3-pip python3-dev python3-venv \
python3-wheel libfreetype6-dev libxml2-dev libzip-dev libsasl2-dev \
python3-setuptools
Now, with that out of the way, navigate to the project’s folder (Assuming you have downloaded a project for example), and create a virtual environment
python3 -m venv venv
Now, you can activate that project with
source venv/bin/activate
//On windows, the above should look something like
venv\Scripts\activate
That is basically it, you will now need to, from within the command prompt of the venv, install dependencies either one by one using the pip command, or point it to a file containing the dependencies, for example
pip install -r requirements.txt
You should now be good to go !
Google Colab
Google colab is a hosted Jupyter Notebooks service from google
It appears to me as though the name is also a pun, a short notation for the word collaboration, and also a CO-Lab as in Jupyter lab
Jupyter Notebooks
Launch
Within the context of our AI tutorial, start by activating your conda environment (Or venv)
Once active, run the following command to launch Jupyter
jupyter lab
Jupyter Notebook = The three languages that are supported are Julia, Python and R. Sure there is a missing E in the words, but i guess the name is 90% cool. The logo pays homage to Galileo’s discovery of the moons of Jupiter, So I am not sure whether the name can be called a pun since the one of them is a shortening of three words and not a name, and a name with a misspelled letter.
Enough about the name and logo, let us get into what a Jupyter Notebook is
Technically, it is a JSON file with a ipynb extension, in reality, it is a way to create a web document “With live code”, equations, among other things
the types of cells in a notebook are
- Code Cells: Execute code and display the output.
- Markdown Cells: Write formatted text using Markdown.
- Raw NBConvert Cells: Include content that is not evaluated by the notebook kernel
So, the markup inside that JSON file is not specific to AI per say, it is used in many science fields, but as you work your way through this blog, you will see how important it is for what we are trying to achieve !
In any case, to start Jupyter Notebook. you run the following command from the terminal where the current directory is your project directory !
jupyter lab
Then, you can open the ipynb files found in there by clicking on them form the menu on the left !
Setting up Anaconda for AI
What is Anaconda ?
Conda, Like pip, is a python package manager, but conda is probably undisputed as the more thorough solution of the two, with better support for non-python packages (pip has very limited support) and support for more complex dependency trees
To clarify things, conda is the package manager while Anaconda is a bigger bundle, if you want to install conda alone, you are probably looking to install Miniconda. Anaconda is a set of about a hundred packages including conda, numpy, scipy, ipython notebook, and so on.
So, let us go through installing and using Anaconda on all 3 platforms, Windows, Linux and Mac
Linux
On Debian, there is no Anaconda package, to install, you will need to download the download script from anaconda and install it (Or conda, or miniconda for that matter) , you can add miniconda to apt using the “https://repo.anaconda.com” repo if you are willing to add it (apt install conda), but here I will assume you will just install Anaconda, and the only orthodox way to do that is with the installation script
Download the Anaconda installer from the Anaconda Website
https://www.anaconda.com/download
Navigate to the downloads folder, and execute the script just downloaded, in my case, the script’s name was Anaconda3-2024.10-1-Linux-x86_64.sh so I execute the following
cd /home/qworqs/Downloads
chmod 0777 Anaconda3-2024.10-1-Linux-x86_64.sh
./Anaconda3-2024.10-1-Linux-x86_64.sh
After accepting the agreement, I see the message
Anaconda3 will now be installed into this location:
/home/qworqs/anaconda3
To which i accepted the suggested location
Now, I opt to keep the installer in the downloads directory just in case something goes wrong, but you can safely delete the 1GB installer if you like !
At the end of the installation, the installer offers to update your shell, in my case, i opted NOT TO, if you opted otherwise, you can always “set auto_activate_base” to false….
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
run the following command when conda is activated:
conda config --set auto_activate_base false
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
The environment
So, to activate an environment, there is a yaml file for every project that contains the dependencies of that project ! if you are following the index page “setup”, you still don’t have one, once you do, come back here and do this, now for the sake of keeping this tutorial generic, let us assume you are in your project’s directory, and the yaml file is called environment.yml , the following command will create a python sub-environment, and install all the dependencies in that yaml file, be sure you are in the directory with the yaml file
//First, add anaconda to path by editing ~/.bash_profile, and adding the following to the bottom of the file
export PATH=~/anaconda3/bin:$PATH
Now, to apply the changes, you should either close the terminal window and re-open it, or run the command “source ~/.bashrc”
To check whether the magic happened, run the command “conda –version”
Now, to create a virtual environment, cd into the directory that has your project and run the following
conda env create -f environment.yml
Once the above is done downloading and installing, you should get a message like the one below
#
# To activate this environment, use
#
# $ conda activate projectName
#
# To deactivate an active environment, use
#
# $ conda deactivate
Now, when you open a terminal, and want to activate an environment
1- conda init (conda deactivate to reverse)
2- open a new shell
3- conda activate ProjectName
OpenAI whisper
Whisper is the leading audio transcription service that can be installed on your own computer, my personal experience with whisper is excellent, in fact it is the best one i know.