Skip to content

Commit

Permalink
Guide for Local AI added
Browse files Browse the repository at this point in the history
 On branch feature/guide
 Changes to be committed:
	new file:   LICENSE
	renamed:    Writerside/images/manjaro/Manjaro_Installiing.png -> Writerside/images/manjaro/Manjaro_Installation.png
	modified:   Writerside/mg.tree
	modified:   Writerside/topics/audio.md
	modified:   Writerside/topics/dev-tools.md
	new file:   Writerside/topics/local-ai.md
	modified:   Writerside/topics/references.md
	modified:   Writerside/topics/setup-system.md
	new file:   _includes/favicon.html
	deleted:    _layouts/default.html
	new file:   assets/css/stylesheet.css
	modified:   docs/webHelpMG2-all.zip
	modified:   index.html
  • Loading branch information
MatiasPujado committed Aug 8, 2024
1 parent 4618cfb commit 43ec8dc
Show file tree
Hide file tree
Showing 13 changed files with 1,074 additions and 36 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Writerside/mg.tree
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
<toc-element topic="version-control.md"/>
<toc-element topic="linux-kernel.md"/>
<toc-element topic="solutions-archive.md"/>
<toc-element topic="local-ai.md"/>
<toc-element topic="references.md"/>
</instance-profile>
73 changes: 70 additions & 3 deletions Writerside/topics/audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Pipewire & Wireplumber

**PipeWire** is a new low-level multimedia framework. It aims to offer capture and playback for both audio and video with minimal latency and support for PulseAudio, JACK, ALSA, and
GStreamer-based applications.
**PipeWire** is a new low-level multimedia framework. It aims to offer capture and playback for both audio and video with minimal latency and support for PulseAudio, JACK, ALSA,
and GStreamer-based applications.

The daemon based on the framework can be configured to be both an audio server (with PulseAudio and JACK features) and a video capture server.

Expand Down Expand Up @@ -44,7 +44,6 @@ speaker-test -c2 -l3 -twav
sudo pacman -S carla
```


## Codecs and multimedia dependencies

```Bash
Expand All @@ -58,3 +57,71 @@ sudo pacman -S --needed gstreamer gstreamer-docs gstreamer-vaapi ffmpegthumbnail
```Bash
pactl load-module module-switch-on-connect
```

## Multimedia Stream Managers

### Helvum

**Helvum** is a GTK-based multimedia stream manager for PipeWire. It allows you to manage streams, devices and nodes, and it can be used to monitor and control the audio and video
streams on your system.

**Helvum** is available on Flathub:

```Bash
flatpak install flathub org.pipewire.Helvum
```

Run it:

```Bash
flatpak run org.pipewire.Helvum
```

### Qpwgraph

**Qpwgraph** is a Qt-based graphical tool for PipeWire. It allows you to monitor and control the audio and video streams on your system.

**Qpwgraph** is available on Flathub:

```Bash
flatpak install flathub org.rncbc.qpwgraph
```

Run it:

```Bash
flatpak run org.rncbc.qpwgraph
```

### Coppwr

**Coppwr** is a GTK-based graphical tool for PipeWire. It allows you to monitor and control the audio and video streams on your system.

**Coppwr** is available on Flathub:

```Bash
flatpak install flathub io.github.dimtpap.coppwr
```

Run it:

```Bash

flatpak run io.github.dimtpap.coppwr
```

### Pwvucontrol

**Pwvucontrol** is a GTK-based graphical tool for PipeWire. It allows you to monitor and control the audio and video streams on your system.

**Pwvucontrol** is available on Flathub:

```Bash
flatpak install flathub com.saivert.pwvucontrol
```

Run it:

```Bash
flatpak run com.saivert.pwvucontrol
```
20 changes: 20 additions & 0 deletions Writerside/topics/dev-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,23 @@ Try running a Docker command without `sudo`:
```Bash
docker run hello-world
```
## Linting {collapsible="true"}
### ESLint
```Bash
sudo pacman -S --needed eslint
```
### Prettier
```Bash
sudo pacman -S --needed prettier prettyping
```
### Stylelint
```Bash
sudo pacman -S --needed stylelint
```
164 changes: 164 additions & 0 deletions Writerside/topics/local-ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Local AI

## Introduction

Local AI is a term used to describe the use of AI models on a local device, such as a smartphone or a computer. This is in contrast to cloud-based AI, where the AI model is hosted
on a remote server and accessed over the internet. Local AI has several advantages, including improved privacy and reduced latency. However, it also has some limitations, such as
limited processing power and storage space.

### Install AMD drivers (ROCm)

```Bash
sudo pacman -S --needed rocm-hip-sdk rocm-opencl-sdk rocm-hip-runtime hip-runtime-amd miopen-hip rocm-opencl-runtime
```

### OpenCL Image support

The latest ROCm versions now includes OpenCL Image Support used by GPGPU accelerated software such as Darktable. ROCm with the AMDGPU open source graphics driver are all that is
required. AMDGPU PRO is not required.

```Bash
❯ /opt/rocm/bin/clinfo | grep -i "image support"
Image support: Yes
```

## LMStudio

LM Studio is a desktop application for running local LLMs on your computer.
Install from AUR:

```Bash
yay -S --needed lmstudio-appimage
```

## Jan AI

Jan is a ChatGPT-alternative that runs 100% offline on your Desktop. Our goal is to make it easy for a person to download and run LLMs and use AI with full control and privacy.
Install from AUR:

```Bash
yay -S --needed jan-bin
```

## Ollama

Ollama is a free and open-source AI assistant that runs locally on your device. It can perform a wide range of tasks, such as answering questions, setting reminders, and playing
music.

### Install from an official repository:

```Bash
sudo pacman -S --needed ollama
sudo systemctl enable --now ollama.service
```

### Install from script:

```Bash
curl -fsSL https://ollama.com/install.sh | sh
```

### Install from source:

Ollama is distributed as a self-contained binary. Download it to a directory in your PATH:

```bash
sudo curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama
sudo chmod +x /usr/bin/ollama
```

### Adding Ollama as a startup service (recommended)

Create a user for Ollama:

```bash
sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama
```

Create a service file in `/etc/systemd/system/ollama.service`:

```ini
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
```

Then start the service:

```bash
sudo systemctl daemon-reload
sudo systemctl enable --now ollama
```

### AMD Radeon GPU support

While AMD has contributed the `amdgpu` driver upstream to the official linux kernel source, the version is older and may not support all ROCm features. We recommend you install the
latest driver from [AMD Official Website](https://www.amd.com/en/support/linux-drivers) for best support of your Radeon GPU.

## Update

Update ollama by running the install script again:

```bash
curl -fsSL https://ollama.com/install.sh | sh
```

Or by downloading the ollama binary:

```bash
sudo curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama
sudo chmod +x /usr/bin/ollama
```

## Installing specific versions

Use `OLLAMA_VERSION` environment variable with the install script to install a specific version of Ollama, including pre-releases. You can find the version numbers in
the [releases page](https://github.com/ollama/ollama/releases).

For example:

```
curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.1.32 sh
```

## Viewing logs

To view logs of Ollama running as a startup service, run:

```bash
journalctl -e -u ollama
```

## Uninstall

Remove the ollama service:

```bash
sudo systemctl stop ollama
sudo systemctl disable ollama
sudo rm /etc/systemd/system/ollama.service
```

Remove the ollama binary from your bin directory (either `/usr/local/bin`, `/usr/bin`, or `/bin`):

```bash
sudo rm $(which ollama)
```

Remove the downloaded models and Ollama service user and group:

```bash
sudo rm -r /usr/share/ollama
sudo userdel ollama
sudo groupdel ollama
```
26 changes: 24 additions & 2 deletions Writerside/topics/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- [Manjaro Wiki](https://wiki.manjaro.org/index.php/Main_Page)
- [Manjaro Linux Forum](https://forum.manjaro.org/)
- [Add Certificated](https://warlord0blog.wordpress.com/2021/01/17/trusting-ca-certificates-manjaro/)

### ZSH Plugins

Expand Down Expand Up @@ -158,6 +159,27 @@
- [Git Tutorial](https://www.atlassian.com/git/tutorials)
- [Git Dubious Ownership Error](https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html)

### Manjaro
### Local AI

- [Add Certificated](https://warlord0blog.wordpress.com/2021/01/17/trusting-ca-certificates-manjaro/)
- [Local AI](https://en.wikipedia.org/wiki/Local_AI)
- [ROCm Archlinux Wiki](https://wiki.archlinux.org/title/GPGPU#ROCm)
- [ROCm Repo](https://github.com/rocm-arch/rocm-arch)

#### LMStudio

- [LMStudio](https://lmstudio.ai/)
- [LMStudio Docs](https://lmstudio.ai/docs/welcome)
- [LMStudio Repo](https://github.com/lmstudio-ai)

#### Ollama

- [Ollama](https://ollama.com/)
- [Ollama Blog AMD](https://ollama.com/blog/amd-preview)
- [Ollama Repo](https://github.com/ollama/ollama)
- [Ollama Docs](https://github.com/ollama/ollama/tree/main/docs)

#### Jan AI

- [Jan AI](https://jana.ai/)
- [Jan AI Docs](https://jan.ai/docs)
- [Jan AI Repo](https://github.com/janhq/jan)
2 changes: 1 addition & 1 deletion Writerside/topics/setup-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ The installation process will start. It will take some time, so be patient. Once

<br/>

![Installing Manjaro](Manjaro_Installiing.png "Installing Manjaro")
![Installing Manjaro](Manjaro_Installation.png "Installing Manjaro")

<br/>

Expand Down
15 changes: 15 additions & 0 deletions _includes/favicon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manjaro Guide</title>
<link rel="stylesheet" href="/assets/css/stylesheet.css">
<link rel="icon" href="/assets/manjaro_180x180.svg">
</head>
<body>
<footer>
<p>&copy; Made with ❤️ by Matias Pujado</p>
</footer>
</body>
</html>
24 changes: 0 additions & 24 deletions _layouts/default.html

This file was deleted.

Loading

0 comments on commit 43ec8dc

Please sign in to comment.