Skip to content

Instantly share code, notes, and snippets.

View Klaudioz's full-sized avatar

Claudio Canales Klaudioz

View GitHub Profile
@andrewyu0
andrewyu0 / obsidian-copilot.md
Last active February 26, 2024 17:29
obsidian-copilot

obsidian copilot

your notes = your lifelong ai companion + intelligence augmentation

COMMENTS VERY WELCOME! this is a first pass to put these ideas in one place

tldr - combine obsidian + openinterpreter to create a bespoke pkm copilot experience. if you follow the "file over app" philosophy, this combination can be your lifetime AI companion

image
@chuyqa
chuyqa / PG_Rag_Benchmarks.ipynb
Last active May 1, 2024 02:07
PGVector Local LLM
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@truebit
truebit / init.lua
Last active March 22, 2024 08:25
Kitty Terminal: pull down from top like iTerm2
local spaces = require("hs.spaces") -- https://github.com/asmagill/hs._asm.spaces
-- Switch kitty
hs.hotkey.bind({'command'}, 'escape', function () -- change your own hotkey combo here, available keys could be found here:https://www.hammerspoon.org/docs/hs.hotkey.html#bind
local BUNDLE_ID = 'net.kovidgoyal.kitty' -- more accurate to avoid mismatching on browser titles
function getMainWindow(app)
-- get main window from app
local win = nil
while win == nil do
@lewtun
lewtun / sft_trainer.py
Last active April 27, 2024 21:28
Fine-tuning Mistral 7B with TRL & DeepSpeed ZeRO-3
# This is a modified version of TRL's `SFTTrainer` example (https://github.com/huggingface/trl/blob/main/examples/scripts/sft_trainer.py),
# adapted to run with DeepSpeed ZeRO-3 and Mistral-7B-V1.0. The settings below were run on 1 node of 8 x A100 (80GB) GPUs.
#
# Usage:
# - Install the latest transformers & accelerate versions: `pip install -U transformers accelerate`
# - Install deepspeed: `pip install deepspeed==0.9.5`
# - Install TRL from main: pip install git+https://github.com/huggingface/trl.git
# - Clone the repo: git clone github.com/huggingface/trl.git
# - Copy this Gist into trl/examples/scripts
# - Run from root of trl repo with: accelerate launch --config_file=examples/accelerate_configs/deepspeed_zero3.yaml --gradient_accumulation_steps 8 examples/scripts/sft_trainer.py
@Birch-san
Birch-san / code-assist.md
Last active March 4, 2024 19:32
Local VSCode AI code assistance via starcoder + 4-bit quantization in ~11GB VRAM

Install HF Code Autocomplete VSCode plugin.

We are not going to set an API token. We are going to specify an API endpoint.
We will try to deploy that API ourselves, to use our own GPU to provide the code assistance.

We will use bigcode/starcoder, a 15.5B param model.
We will use NF4 4-bit quantization to fit this into 10787MiB VRAM.
It would require 23767MiB VRAM unquantized. (still fits on a 4090, which has 24564MiB)!

Setup API

@perkinsjr
perkinsjr / middleware.ts
Last active January 31, 2024 11:06
Using Clerk with Upstash for Middleware rate limiting and API Protection
import { getAuth, withClerkMiddleware } from "@clerk/nextjs/server";
import { NextResponse, NextFetchEvent } from "next/server";
import type { NextRequest } from "next/server";
import { Ratelimit } from "@upstash/ratelimit";
import { Redis } from "@upstash/redis";
// Add public paths for Clerk to handle.
const publicPaths = ["/", "/sign-in*", "/sign-up*", "/api/blocked"];
// set your rate limit.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const awsTool = new DynamicTool({
name: "aws-cli",
description:
"This is AWS CLI. You can call this to send commands to the AWS Cloud. Use AWS CLI format like `aws s3api list-buckets`",
async func(command) {
const args = command.split(" ").filter((x) => x !== "aws");
const result = spawnSync("aws", args, {
env: {
...process.env,
AWS_REGION: "eu-central-1",
@rain-1
rain-1 / LLM.md
Last active May 3, 2024 10:05
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.