Text Generation
Transformers
ONNX
Safetensors
GGUF
Transformers.js
English
gpt2
humor
parody
tiny
chat
lm-studio
ollama
llama.cpp
gpt
meme
funny
joke
satire
ram
ram-shortage
tiny-model
small-model
micro-model
toy-model
trained-from-scratch
custom-tokenizer
synthetic-data
conversational
chatbot
cpu
low-resource
text-generation-inference
Instructions to use brunuu/RAM_Altman_GPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use brunuu/RAM_Altman_GPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="brunuu/RAM_Altman_GPT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("brunuu/RAM_Altman_GPT") model = AutoModelForCausalLM.from_pretrained("brunuu/RAM_Altman_GPT", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Transformers.js
How to use brunuu/RAM_Altman_GPT with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'brunuu/RAM_Altman_GPT'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use brunuu/RAM_Altman_GPT with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf brunuu/RAM_Altman_GPT:F16 # Run inference directly in the terminal: llama cli -hf brunuu/RAM_Altman_GPT:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf brunuu/RAM_Altman_GPT:F16 # Run inference directly in the terminal: llama cli -hf brunuu/RAM_Altman_GPT:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf brunuu/RAM_Altman_GPT:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf brunuu/RAM_Altman_GPT:F16
Use Docker
docker model run hf.co/brunuu/RAM_Altman_GPT:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use brunuu/RAM_Altman_GPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "brunuu/RAM_Altman_GPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brunuu/RAM_Altman_GPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/brunuu/RAM_Altman_GPT:F16
- SGLang
How to use brunuu/RAM_Altman_GPT with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "brunuu/RAM_Altman_GPT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brunuu/RAM_Altman_GPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "brunuu/RAM_Altman_GPT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brunuu/RAM_Altman_GPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use brunuu/RAM_Altman_GPT with Ollama:
ollama run hf.co/brunuu/RAM_Altman_GPT:F16
- Unsloth Desktop
- Docker Model Runner
How to use brunuu/RAM_Altman_GPT with Docker Model Runner:
docker model run hf.co/brunuu/RAM_Altman_GPT:F16
- Lemonade
How to use brunuu/RAM_Altman_GPT with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull brunuu/RAM_Altman_GPT:F16
Run and chat with the model
lemonade run user.RAM_Altman_GPT-F16
List all available models
lemonade list
- Atomic Chat
File size: 7,421 Bytes
7de15fc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | import random
from pathlib import Path
from vocab import *
OUTPUT_FILE = Path(__file__).resolve().parent.parent / "data" / "ram_altman.txt"
END_TOKEN = "<|i_have_enough_ram|>"
N_SAMPLES = 200_000
CONVERSATION_CHANCE = 0.15
MAX_REPLY_WORDS = 170 # pair must fit in the 379 token context
MAX_CONVERSATION_REPLY_WORDS = 70
def fill(template, word=""):
template = template.replace("{W}", word.upper())
while "{size}" in template:
template = template.replace("{size}", random.choice(SIZES), 1)
while "{type}" in template:
template = template.replace("{type}", random.choice(TYPES), 1)
return template
def burst(lo, hi):
groups = [RAM, BEGS, SIZES, TYPES, ["MORE"], LORE]
parts = [random.choice(random.choices(groups, weights=[30, 20, 18, 12, 10, 10])[0])
for _ in range(random.randint(lo, hi))]
if random.random() < 0.85:
parts.append(random.choice(RAM))
return " ".join(parts)
def sentences(lo, hi):
out = fill(random.choice(SENTENCES))
for _ in range(random.randint(lo, hi) - 1):
out += random.choice(SEPARATORS) + fill(random.choice(SENTENCES))
return out
def spam():
return " ".join([random.choice(SPAM_WORDS)] * random.randint(10, 30))
def rant(lo, hi):
chunks = []
for _ in range(random.randint(lo, hi)):
r = random.random()
chunks.append(sentences(1, 3) if r < 0.45 else burst(5, 12) if r < 0.85 else spam())
return random.choice(SEPARATORS).join(chunks)
def tail(size):
if size == "short":
return random.choice(["", burst(1, 4)])
if size == "normal":
return random.choice([sentences(1, 3), burst(4, 10)])
if size == "medium":
return random.choice([sentences(3, 5), burst(10, 20), rant(2, 3)])
return rant(7, 12) # Giant
def reply_size(user, rant=False):
# longer messages tend to get longer replies; unknown topics get the rant
# tuned so the reply length median lands around 15 words
n = len(user.split())
if rant:
weights = [28, 50, 16, 6] if n <= 9 else [22, 50, 20, 8]
else:
weights = [48, 40, 10, 2] if n <= 3 else [43, 44, 11, 2] if n <= 9 else [33, 45, 16, 6]
return random.choices(["short", "normal", "medium", "giant"], weights)[0]
def join(reply, rest):
if not rest:
return reply
return reply + (" " if not reply[-1].isalnum() else random.choice(SEPARATORS)) + rest
def finish(reply, max_words=MAX_REPLY_WORDS):
reply = " ".join(reply.split()[:max_words])
if random.random() < 0.01:
reply = join(reply, FALSE_ENDING)
if reply[-1].isalnum():
reply += random.choice(ENDINGS)
return reply
# user text
def style(line):
r = random.random()
line = line[0].upper() + line[1:] if r < 0.45 else line.upper() if r < 0.55 else line.lower()
if line[-1].isalnum() and random.random() < 0.5:
line += random.choice(USER_PUNCTUATION)
return line
def lengthen(line):
if random.random() < 0.25:
line = line.rstrip("?!.") + ". " + ". ".join(random.sample(FILLERS, random.randint(1, 3)))
return line
def pluralize(word):
if word.endswith("s"): # news, chess, tennis, bus...
return word
if word.endswith("y") and word[-2] not in "aeiou":
return word[:-1] + "ies"
if word.endswith(("x", "ch", "sh", "o")):
return word + "es"
return word + "s"
def random_noun():
word = random.choice(NOUNS)
return pluralize(word) if random.random() < 0.4 else word
def topic_word():
return random.choice(random.choice(list(TOPICS.values()))["words"])
def topic_pair():
topic = random.choice(list(TOPICS.values()))
word = random.choice(topic["words"])
hook = random.choice(ECHO_HOOKS if random.random() < 0.25 else topic["hooks"])
return lengthen(random.choice(TOPIC_TEMPLATES).format(w=word)), hook, word
def noun_pair():
user = lengthen(random.choice(TOPIC_TEMPLATES).format(w=random_noun()))
return user, random.choice(DISMISS_HOOKS), None
def reaction_pair():
messages, replies = random.choice(list(REACTIONS.values()))
return random.choice(messages), random.choice(replies), None
def math_pair():
a, b = random.randint(0, 9), random.randint(0, 9)
if random.random() < 0.5:
user = random.choice(MATH_DIGITS).format(a=a, b=b)
else:
user = random.choice(MATH_WORDS).format(a=NUMBERS[a], b=NUMBERS[b])
return user, random.choice(MATH_REPLIES).replace("{s}", str(a + b)), None
def ram_pair():
n = random.choice(SIZES)
user = random.choice(RAM_AMOUNT_USER).format(n=n)
reply = random.choice(RAM_AMOUNT_REPLIES).replace("{n}", n)
return user, reply, None
def generic_pair():
if random.random() < 0.5:
user = random.choice(GENERIC_QUESTIONS)
else:
user = random.choice(TOPIC_TEMPLATES).format(w=random.choice(GENERIC_WORDS))
return lengthen(user), random.choice(SENTENCES), None
def first_message(kinds, weights):
user, hook, word = random.choices(kinds, weights)[0]()
return style(user), fill(hook, word or ""), word
def single_pair():
kinds = [topic_pair, noun_pair, reaction_pair, math_pair, generic_pair, ram_pair]
weights = [28, 12, 25, 8, 12, 15]
kind = random.choices(kinds, weights)[0]
user, reply, word = kind()
rant = kind in (noun_pair, generic_pair, ram_pair)
return style(user), finish(join(fill(reply, word or ""), tail(reply_size(user, rant=rant))))
def conversation():
# remembers what the user said, still only wants RAM and asks for more
level = random.randint(1, 8)
user, reply, _ = first_message([topic_pair, noun_pair, reaction_pair, ram_pair], [40, 30, 15, 15])
reply += ("." if reply[-1].isalnum() else "") + f" I NEED {SIZES[level]}"
turns = [(user, finish(join(reply, tail("normal")), MAX_CONVERSATION_REPLY_WORDS))]
for _ in range(random.randint(1, 3)):
prev = SIZES[level]
level = min(level + random.randint(1, 3), len(SIZES) - 1)
size = SIZES[level] if level < len(SIZES) - 1 else FINAL_OFFER
if random.random() < 0.8: # "and X?"
echo = random.random() < 0.5 # topic words are echoed, anything else ignored
word = topic_word() if echo else random_noun()
user = style(random.choice(FOLLOW_UPS_WORD).format(w=word))
replies = FOLLOW_UP_ECHO_REPLIES if echo else FOLLOW_UP_DISMISS_REPLIES
reply = fill(random.choice(replies).replace("{esc}", size), word)
else: # "why?", "ok", "stop"
messages, replies = random.choice(list(FOLLOW_UPS_PLAIN.values()))
user = style(random.choice(messages))
reply = fill(random.choice(replies).replace("{esc}", size).replace("{prev}", prev))
rest = tail(random.choice(["short", "normal", "medium", "medium"]))
turns.append((user, finish(join(reply, rest), MAX_CONVERSATION_REPLY_WORDS)))
return turns
if __name__ == "__main__":
random.seed(42)
n_pairs = 0
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
for _ in range(N_SAMPLES):
turns = conversation() if random.random() < CONVERSATION_CHANCE else [single_pair()]
for user, reply in turns:
f.write(f"User: {user}\nRAM-ALTMAN: {reply}{END_TOKEN}\n")
n_pairs += len(turns)
print(f"{OUTPUT_FILE.name}: {N_SAMPLES:,} samples, {n_pairs:,} pairs")
|