Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
![Screenshot 2023-12-18 at 10 40 27 PM](https://private-user-images.githubusercontent.com/3837836/291468646-4c30ad72-76ee-4939-a5fb-16b570d38cf2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg2NDk2NjUsIm5iZiI6MTcxODY0OTM2NSwicGF0aCI6Ii8zODM3ODM2LzI5MTQ2ODY0Ni00YzMwYWQ3Mi03NmVlLTQ5MzktYTVmYi0xNmI1NzBkMzhjZjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MTdUMTgzNjA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2U1ODRiNjRhNjI3MzY4ZDMzYmViMWY2OGU2MzEzMDA5NWRjOWE5OGU2ODU0M2U3MjExNjcwMmJlOTRkNTdiYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.xXj8xg62mqzcTXBMEerAcu-GnqcSMqPKG9YP188eWsY)
# Clone llama.cpp | |
git clone https://github.com/ggerganov/llama.cpp.git | |
cd llama.cpp | |
# Build it | |
make clean | |
LLAMA_METAL=1 make | |
# Download model | |
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |
# I couldn't get return generators from chains so I had to do a bit of low level SSE, Hope this is useful | |
# Probably you'll use another Vector Store instead of OpenSearch, but if you want to mimic what I did here, | |
# please use the fork of `OpenSearchVectorSearch` in https://github.com/oneryalcin/langchain | |
import json | |
import os | |
import logging | |
from typing import List, Generator |
import os | |
os.environ["OPENAI_API_KEY"] = "" | |
from flask import Flask, Response, request | |
import threading | |
import queue | |
from langchain.chat_models import ChatOpenAI | |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler | |
from langchain.schema import AIMessage, HumanMessage, SystemMessage |
Important: This microbenchmark is not intended to represent any real workload. Compression ratios, and therefore performance, will depend heavily on the specific workload. This is only for the purpose of illustrating a "columnar friendly" contrived workload that showcases the benefits of columnar.
/** | |
* Parse Airtable's "ConstantPooledData" format. They recently started using | |
* this format to compress some API responses, and it appears to be a | |
* home-grown format. | |
* | |
* Call `parseData()` if you have an object with data (e.g. a JSON-parsed API | |
* response body). | |
* | |
* Call `parseString()` if you have a raw string of data (e.g. an API response | |
* body). |
<%= form_with(model: team) do |form| %> | |
<div> | |
<%= form.label :name %> | |
<%= form.text_field :name, class: "input" %> | |
</div> | |
<div> | |
<%= f.select :user_id, {}, {placeholder: "Select user"}, {class: "w-full", data: { controller: "select", select_url_value: users_path }} %> | |
</div> |
import requests | |
#Fetch existing tables | |
tables = requests.post('http://localhost:8080/v1/query', json={ | |
"type":"select", | |
"args":{ | |
"table": {"schema": "information_schema", "name": "tables"}, | |
"columns": ["table_name"], | |
"where": {"table_schema": {"$eq": "public"}} | |
} |
#!/bin/bash | |
## Install and Setup TiDB on Linux | |
## https://github.com/pingcap/tidb | |
## https://github.com/pingcap/docs/blob/master/sql/privilege.md | |
## https://pingcap.com/blog/2016-10-17-how-we-build-tidb/ | |
useradd tidb -d /var/lib/tidb -m | |
usermod -a -G tidb tidb | |
cd /var/lib/tidb |