Categories
Home-Server MachineLearning

Using AI in programming Part 3

To make it short: I’m now using an existing opensource tool for VSCode which can point to my local server. It’s called open copilot and is licensed under Apache 2 which allows commercial use.

Once setting up the url for your local server you can query the extension “cody” with the icon on the left sidebar or within inline code.

Its somewhat usable on my machine.

Categories
Common

Using AI in programming Part 2

Here i will describe how to install the code llama modell on one of your VM’s. Problem here is that you usually loose the GPU support because MS is still not able to provide GPU-P for Hyper-V. TY MS at this point.

First prepare a vm, I’m choosing ubuntu srv 22.04.03 LTS. Assigning 8 cores and 64GB of RAM.

Check if git is installed (insert “git –version” in the terminal):

Clone the llama.cpp project, insert the following commands in the terminal (“make” w/o anything is cpu only, you may need to install the gcc compiler):

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
sudo apt install build-essential //gcc compiler
make

Downloading the model can be done with a nice script:

bash <(curl -sSL https://g.bodaay.io/hfd) -m TheBloke/CodeLlama-70B-hf-GGUF --concurrent 8 --storage models/

After downloading the modell, we can start llama.cpp.

./server \
    --model ./models/TheBloke_CodeLlama-70B-hf-GGUF/codellama-70b-hf.Q5_K_M.gguf --host 192.168.50.13 --port 8080 -c 2048

Next step would be to create a plugin for VS e.g. to autofill code from commentblock.

Categories
Common

Using AI in programming

This is a an example on how to use AI in your own environment. I’m using the popular LLM Code Llama from Meta which is open source (also for commercial use) and supports C#, my main programming language. Another advantage is that you can use it in your own environment and your most value asset the sourcecode will not leave your network.

Code Llama comes in different sizes, I’m currently using the 70B Model which returns the best result but requires quite a bit of resources. I’m showing you how to self host a tool which runs the llm locally on a central server and write a simple VSCode extension to access the api to query results.

But first lets try to run it locally on my development machine. For this just install ollama (MIT License) and select the model from meta.

It usually gives you a code snipped and an explanation. It works, but it may be a bit inconvenient. In the next post, I’ll show you how to run the modell on your own virtual environment and access it via web or inside your code editor.

Categories
Common

Failed to start gitea on Fedora 38 after update

Maybe this helps other user. Just updated gitea and service refused to start: Process: 48241 ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini (code=exited, status=203/EXEC)

In the log (journalctl -b 0 -u gitea) there are permission issues: gitea.service: Failed at step EXEC spawning /usr/local/bin/gitea: Permission denied

I checked permissions and they are ok. Found out that selinux flagged that file as user_home_t as it was downloaded to that location.

Fixed the issue with command (sudo restorecon -rv /usr/local/bin/gitea) to remove the user_home flag.

Categories
Common

Automatisierung des Postident Portals

Aus einem Kundenprojekt kam die Anfrage den Identifizierungsprozess z.b. mittels Personalausweis und Videoident einfach über einen internen Prozess starten zu können und die Ergebnisdaten nach Abschluss des Falles entsprechend zu verarbeiten. Das Projekt wurde in C#/Asp.Net umgesetzt und läuft auf einem internen Webserver. Die Ergebnisdaten werden per Cronjob einmal am Tag abgerufen und bei Änderungen im Status entsprechend behandelt, zumeist archiviert.

Der Code stellt nur Ausschnitte des Projektes dar, wer Interesse an einer konkreten Implementierung hat kann sich gerne an mich wenden.

Prepare a call to create a new case:

Perform api call and process result with caseId:

Categories
Common

SSD upgrade on a Samsung Galaxy Flex 2 5G (not possible)

Seems that the Notebook uses not a standard 2280 m.2 SSD but instead a much smaller one (maybe 2230). I just wanted to install a Samsung 980 Pro on my exemplar but aborted the operation.

The SSD is above the Battery in the middle.

The SSD is under the Metal Frame in the Middle above the Battery.

Btw.: Disassembly is pretty easy: Just remove 4 screws and use a suction cup on the front corner on the bottom (not on back side at hinge area which seems to be much stronger).

Categories
Home-Server

Updating to Windows Server 2022

In this video I’ll show you how smoth the inplace update to Windows Server 2022 could be. The goal will be to finally enable GPU-P for my virtual machines (currently this is still not working though).

Categories
Home-Server

Creating VM environment with PowerShell

To put the Server to good use i will use it to create a VM Test Environment via script. What the script does is to create a copy of the existing VMs (their VHDs) with a prefix and attach them to a private network. With this approach it is easy to test software updates etc.

The script takes two parameters: The prefix of the new environment and the location of the template VMs.

Categories
Home-Server

Final stage of my Server

After installing the new Epyc 7443P, my server is now fully build. I’ve startet with a first gen Epyc and this is now the inventory with the main parts:

  • Chassis is a Nanoxia Deep Silence 6 Rev B (i can really recommend it)
  • Asrockrack ROMED8-2T Mainboard
  • AMD Epyc 7443P
  • 8x Kingston Server Premier 32GB DDR4-3200 CL22 (KSM32RD4/32MEI)
  • 2x ASUS Hyper M.2 x16 Gen 4 (with each 4x 1TB 970 Evo Plus NVMe) total of 8TB NVMe in a 4 Column Storage Spaces mirror configuration
  • (6+1)x Seagate Exxos X16 & (12 +1) x Samsung 860 Evo in a tiered storage 3 column mirror configuration. Each tier has a hot spare.
  • Microsemi Adaptec HBA 1100-16i and Broadcom HBA 9405W-16i as Storage controllers
  • SSD Enclose from ICY Dock (ICY DOCK ToughArmor MB998IP-B, ICY DOCK ToughArmor MB516SP-B)
  • Total of 10x 14cm Arctic ARCTIC F14 PWM PST CO Fan, but don’t worry i have many fans but the noise level is really low.
  • 1x Intel X550-T2 from the Mainboard and 1x Intel X710-T2L as an expansion card for network connectivity.

Later maybe i will add an a4000 from Nvidia to the last available PCIe Slot. Who knows maybe VGPU will make it to the prosumer market in the future.

In my opinion this is a balanced build and a good example for a hyperconverged server. The Server has the Hyper-V as well as the Storage role. I’m pretty much set for the next 3-5 Years.

Categories
Home-Server

A new EPYC 7443P

Just bought and installed the new AMD EPYC on my Board and its 2x as fast as my previous processor the 7351P. For the processor to run you need to update the Bios of the Board. One bad thing is, that the Board supports only GEN2 and Gen3 EPYCs after the update and not my old one. So in case of a defect of the processor i have to downgrade the BIOS. Currently I’m struggeling a bit to update the BMC of the Board as well. The main reason for that update is, that the FAN controls are managed by the BMC and not by the BIOS. And currently i have no fan control.

Update (30.08.2021): Managed to install BMC Version 1.11 which has Fan-Control. So I’m fine with it although there is currently a version 1.19 available which cannot be installed (stops at the verification step).