AI self hosted, privacy gains (potential Beyond Monopolies episode)
Motivation
Artificial Intelligence (AI) is often presented like a complex field, the state of the art being impossible to understand, models too large to train, incredible work in progress moving forward that could change anything, yet a black box inscrutable for anyone except the selected few.
This is truly damaging to the field as it is a fascinating topic and even though indeed nobody can understand it all, we can all benefit from tinkering with it, learning from it and possibly even using it.
It's also often showcased as impractical for a "normal" person with their "normal" computer. Consequently everything must be done in the "cloud", far away from our scrutiny.
This is also damaging as it is simply false. Some very large models are indeed too large to run on a single computers but most, including what was considered the state of the art just a couple of years ago. In fact the trend to scale might be problematic for the entire field.
Regardless of all those limitation the goal here is to showcase that even though not everything can be done on your desktop, a lot can. Composing from that and learning how it works can help to reconsider a potential feeling of helplessness.
Not only can you self-host AI models, use them, adapt them, but there is a whole community and set of tools to help you do so. This movement itself is very encouraging. AI does not have to be a block box. Your digital life does not have to be owned by someone else, even for the state of the art.
Requirements
Software
Familiarity with self-hosting, e.g Linux command line, see Shell, and containerization, e.g Docker. Ideally familiarity with Python the most popular work in AI is currently often done in that Programming language.
Hardware
A desktop with a proper graphic card is recommended. Some solutions do not need it all while others need the last generation of GPU. It is also possible to rend such a configuration in the cloud if necessary, while insuring that the cloud provided has terms of services and overall practices aligned with your needs.
Ideal
Linux desktop with latest generation NVIDIA GPU, Docker installed and running with NVIDIA support.
Used locally
- NLP (NLTK)
- face tracking (OpenCV)
- OCR (Tesseract)
- ..? (TensorFlowJS)
- VR and AI workshops with Yannel
- face tracking (Human)
- live deep fake (avatarify)
- green screen (OBS plugin)
- swarm robotics simulation (Argos)
- STT (vosk, deepspeech, long before that PockerSphinx)
- image to 3D avatar (PifHUD)
- video understanding (PySlowFast)
- translation (mozilla, OpenNMT via LibreTranslate)
- edge computer vision (OAK-D)
- segmentation (DIS)
- tf-idf (gensim)
- in browser NLP (nlp_compromise)
- text-to-image (min(DALL·E), Stable Diffusion)
- summarization (bart-large-cnn)
- alpaca.cpp (chat based on LLaMA)
- bloomz.cpp (completion relying on BLOOM)
- SantaCoder (code generation built from The Stack)
- CoquiTTS (to test HuggingFace Spaces deploy to Docker)
- turbocopilot (code generation relying on llama.cpp)
- whisper.cpp (STT to generate caption, e.g https://twitter.com/utopiah/status/1649332186233950208 )
- GPT4All-J via Nomic AI chat UI Installer
- shape-E
- Immich
Used non locally but still open
example as tweets
- long video, via its transcript, to short text summary
- motivation
- image to shape (PiFHUD)
- STT (local) and translation (remote, Deepl)
- text-to-image for XR
Remarks
- Suppose text input. including dataAsURI
- model card to CO2 equivalent
Typical process
- discover news about AI
- live demo availability, if so try with own data
- open-source repository
- models availability
- image availability, as Docker or replicate (cog)
- otherwise make Dockerfile
- very often relying on Anaconda3
- try locally
- if out of memory (e.g OOM error with Torch) look for slimmed down version
- if no Web interface available, use Python or NodeJS to make a basic interface
- build demo using the Web API, integrating with other tools, e.g WebXR
Tooling
- generic
- dedicated
- cog
- Gradio
- HuggingFace Transformers with its pipeline
- NLTK with its .download() to directly get models and datasets
- torch
- tensorflow
- jax
Constrained model pathfinder
- starting locally then server then cloud
- cascading : [url1, url2, url3]
- usage base, eg try to use generic terms from model cards and if not fallback to model names
- Telegram bot as mobile interface
- cloud-init Docker https://stackoverflow.com/questions/24418815/how-do-i-install-docker-using-cloud-init/62540068 that could point to a specific Dockerfile URL or to an existing image on official Hub image or nvcr.io, etc
- can be prioritizing
- locality for privacy
- remote for CO2 equivalence
- a composite based on user weighting
Training followed
- university training
- MOOCs
- AIClass
- MLClass
- Coursera
- Sequences, Time Series and Prediction
- Natural Language Processing in TensorFlow
- Convolutional Neural Networks in TensorFlow
- Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning
- Computational Molecular Evolution
- Dataquest.io
- Data Cleaning Course
- Data Science Projects Course
- Data Visualization Course
To try
See also