Skip to content

Instantly share code, notes, and snippets.

View radu-matei's full-sized avatar

Radu Matei radu-matei

View GitHub Profile
@radu-matei
radu-matei / spinkube-pi.md
Last active April 11, 2024 06:46
Setting up SpinKube on a Raspberry Pi cluster with k3s

This is a 5-node Raspberry Pi 5 cluster, assembled from PicoCluster, with an integrated power source and 8-port network switch and cooling fan.

This means it can be plugged in to power with a single power cable, and you can connect to any of the 5 boards using a single ethernet cable.

image

The goal of this tutorial is to configure the Pi cluster to run Kubernetes. To do so, we need to:

  • install an operating system on all the nodes
  • enable cgroups to run containers on each node
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "cdbf6f41381e5ee4810b4b09284b603d8f18365d" },
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"copilot.lua": { "branch": "master", "commit": "73047082d72fcfdde1f73b7f17ad495cffcbafaa" },
"dark-notify": { "branch": "master", "commit": "891adc07dd7b367b840f1e9875b075fd8af4dc52" },
"diffview.nvim": { "branch": "main", "commit": "0437ef8bfdd67156d87140d692840a3c2824fa20" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
[buildPlans.spin-mono]
family = "Spin Mono"
spacing = "term"
serifs = "sans"
no-cv-ss = true
export-glyph-names = true
[buildPlans.spin-mono.variants]
inherits = "ss09"
use std::{fs::File, io::Read};
use anyhow::Result;
use futures::SinkExt;
use spin_sdk::{
http::{Fields, IncomingRequest, OutgoingResponse, ResponseOutparam},
http_component,
};
const CHUNK_SIZE: usize = 1 * 1024 * 1024; // 1 MB
const PROMPT: &str = r#"
<<SYS>>
You are a bot that generates short summaries for conversations given a conversation history between a user and an AI assistant. The summaries should be as concise as possible
<</SYS>>
Follow the pattern of the following examples:
[INST]
PROMPTS
User: When was da Vinci born?
Assistant: Leonardo da Vinci was born on April 15, 1452.
User: how old was he when he painted the Mona Lisa?
@radu-matei
radu-matei / index.html
Created October 3, 2023 14:39
STREAM START HERE
<!DOCTYPE html>
<html>
<head>
<title>Spin and Large Language Models</title>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
</head>
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
@radu-matei
radu-matei / telescope.lua
Created April 2, 2023 11:33
Random config
require('telescope').setup {
defaults = {
selection_caret = "» ",
initial_mode = "insert",
selection_strategy = "reset",
sorting_strategy = "ascending",
layout_strategy = "horizontal",
layout_config = {
horizontal = {
prompt_position = "top",
package main
import (
"fmt"
"net/http"
spinhttp "github.com/fermyon/spin/sdk/go/http"
)
func init() {
@radu-matei
radu-matei / examples.md
Last active March 22, 2023 14:12
Example Spin Applications

Spin Example Applications