Safetensors
olmo2

Remove Colab_Serve and Kaggle_Serve notebooks containing plaintext OAuth token

#1
Colab_Serve_Shreyansh_7B.ipynb DELETED
@@ -1,93 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "markdown",
5
- "metadata": {},
6
- "source": [
7
- "# \u26a1 Shreyansh STEM AI 7B \u2014 Private GPU Server for NextChat\n",
8
- "Run this single cell on **Google Colab (Free T4 GPU)** to serve your private 7B model.\n",
9
- "It produces an encrypted Cloudflare URL that connects directly to **NextChat**."
10
- ]
11
- },
12
- {
13
- "cell_type": "code",
14
- "execution_count": null,
15
- "metadata": {},
16
- "outputs": [],
17
- "source": [
18
- "# Google Colab / Kaggle 1-Cell Ultralight vLLM Server\n",
19
- "# Serves your private 7B model directly to NextChat over Cloudflare Tunnel\n",
20
- "\n",
21
- "!pip install -q vllm cloudflared huggingface_hub\n",
22
- "\n",
23
- "import os, time, subprocess, re, urllib.request\n",
24
- "\n",
25
- "HF_TOKEN = \"hf_oauth_eyJhbGciOiJFZERTQSIsImtpZCI6IjVHZDBvd0g5MTM2eDZjc1FvbE1zcktNWUZoRVFoUm5PVVVybEpjOUhaUEEifQ.eyJzY29wZSI6WyJtYW5hZ2UtcmVwb3MiLCJ3cml0ZS1yZXBvcyIsInJlYWQtcmVwb3MiLCJnYXRlZC1yZXBvcyIsImNvbnRyaWJ1dGUtcmVwb3MiLCJ3cml0ZS1jb2xsZWN0aW9ucyIsInJlYWQtY29sbGVjdGlvbnMiLCJvcGVuaWQiLCJ3cml0ZS1kaXNjdXNzaW9ucyIsImluZmVyZW5jZS1hcGkiLCJqb2JzIiwid2ViaG9va3MiLCJyZWFkLWJpbGxpbmciLCJyZWFkLW1jcCJdLCJhdWQiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIiwiY2xpZW50X2lkIjoiMjZiZTZiMDktOTFjNS00N2RhLTk4NjEtZDJkMmJiN2E3ZTM2Iiwic2Vzc2lvbklkIjoiNmE4M2JhMjFhNzA4MTI5N2M3MTFmODUxIiwiaWF0IjoxNzg4MTQwNjEyLCJqdGkiOiJhY2M5OGQ0ZS1hNTc4LTQ2YTgtYWJkMi1kNmUwNzEwYmUyNjMiLCJzdWIiOiI2YTgzYmEyMGE3MDgxMjk3YzcxMWY4NDgiLCJleHAiOjE3OTA3MzI2MTIsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.otDwERBZtwyVZ9MKlSeN3upQehQiq_qnVjo357RJeioLOi7V8GH47TNFK-ZgoLcrLxs_wZaJvsC04UE2oA88Bg\"\n",
26
- "MODEL_ID = \"shreyansh12183/Shreyansh-STEM-AI-7B-Final\"\n",
27
- "\n",
28
- "os.environ[\"HF_TOKEN\"] = HF_TOKEN\n",
29
- "os.environ[\"HUGGING_FACE_HUB_TOKEN\"] = HF_TOKEN\n",
30
- "\n",
31
- "print(\">>> Starting vLLM Engine on GPU...\")\n",
32
- "vllm_cmd = [\n",
33
- " \"python3\", \"-m\", \"vllm.entrypoints.openai.api_server\",\n",
34
- " \"--model\", MODEL_ID,\n",
35
- " \"--served-model-name\", \"shreyansh-stem-7b\",\n",
36
- " \"--port\", \"8000\",\n",
37
- " \"--gpu-memory-utilization\", \"0.92\",\n",
38
- " \"--max-model-len\", \"4096\",\n",
39
- " \"--trust-remote-code\",\n",
40
- " \"--dtype\", \"half\"\n",
41
- "]\n",
42
- "server_proc = subprocess.Popen(vllm_cmd)\n",
43
- "\n",
44
- "# Wait for server to become healthy\n",
45
- "print(\">>> Waiting for weights to mount in VRAM...\")\n",
46
- "for _ in range(60):\n",
47
- " try:\n",
48
- " req = urllib.request.urlopen(\"http://127.0.0.1:8000/v1/models\", timeout=2)\n",
49
- " if req.status == 200:\n",
50
- " print(\">>> \u2705 vLLM Engine is live!\")\n",
51
- " break\n",
52
- " except Exception:\n",
53
- " time.sleep(5)\n",
54
- "\n",
55
- "# Download cloudflared binary\n",
56
- "!wget -q -nc https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64\n",
57
- "!chmod +x cloudflared-linux-amd64\n",
58
- "\n",
59
- "print(\">>> Punching encrypted Cloudflare tunnel...\")\n",
60
- "tunnel_proc = subprocess.Popen(\n",
61
- " [\"./cloudflared-linux-amd64\", \"tunnel\", \"--url\", \"http://127.0.0.1:8000\"],\n",
62
- " stdout=subprocess.PIPE,\n",
63
- " stderr=subprocess.STDOUT,\n",
64
- " text=True\n",
65
- ")\n",
66
- "\n",
67
- "for line in iter(tunnel_proc.stdout.readline, ''):\n",
68
- " if \"trycloudflare.com\" in line:\n",
69
- " match = re.search(r'https://[a-zA-Z0-9-]+\\.trycloudflare\\.com', line)\n",
70
- " if match:\n",
71
- " url = match.group(0)\n",
72
- " print(\"\\n\" + \"=\"*70)\n",
73
- " print(\"\ud83c\udf89 COPY THIS URL INTO NEXTCHAT SETTINGS -> CUSTOM ENDPOINT:\")\n",
74
- " print(f\"{url}\")\n",
75
- " print(\"=\"*70 + \"\\n\")\n",
76
- " break\n",
77
- "\n",
78
- "server_proc.wait()\n"
79
- ]
80
- }
81
- ],
82
- "metadata": {
83
- "accelerator": "GPU",
84
- "colab": {
85
- "provenance": []
86
- },
87
- "language_info": {
88
- "name": "python"
89
- }
90
- },
91
- "nbformat": 4,
92
- "nbformat_minor": 0
93
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Kaggle_Serve_Shreyansh_7B.ipynb DELETED
@@ -1,93 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "markdown",
5
- "metadata": {},
6
- "source": [
7
- "# \u26a1 Shreyansh STEM AI 7B \u2014 Private Kaggle GPU Server for NextChat\n",
8
- "Run this notebook with **Accelerator: GPU T4 x2** on Kaggle.\n",
9
- "It serves your private 7B model directly to NextChat over an encrypted Cloudflare tunnel."
10
- ]
11
- },
12
- {
13
- "cell_type": "code",
14
- "execution_count": null,
15
- "metadata": {},
16
- "outputs": [],
17
- "source": [
18
- "# Google Colab / Kaggle 1-Cell Ultralight vLLM Server\n",
19
- "# Serves your private 7B model directly to NextChat over Cloudflare Tunnel\n",
20
- "\n",
21
- "!pip install -q vllm cloudflared huggingface_hub\n",
22
- "\n",
23
- "import os, time, subprocess, re, urllib.request\n",
24
- "\n",
25
- "HF_TOKEN = \"hf_oauth_eyJhbGciOiJFZERTQSIsImtpZCI6IjVHZDBvd0g5MTM2eDZjc1FvbE1zcktNWUZoRVFoUm5PVVVybEpjOUhaUEEifQ.eyJzY29wZSI6WyJtYW5hZ2UtcmVwb3MiLCJ3cml0ZS1yZXBvcyIsInJlYWQtcmVwb3MiLCJnYXRlZC1yZXBvcyIsImNvbnRyaWJ1dGUtcmVwb3MiLCJ3cml0ZS1jb2xsZWN0aW9ucyIsInJlYWQtY29sbGVjdGlvbnMiLCJvcGVuaWQiLCJ3cml0ZS1kaXNjdXNzaW9ucyIsImluZmVyZW5jZS1hcGkiLCJqb2JzIiwid2ViaG9va3MiLCJyZWFkLWJpbGxpbmciLCJyZWFkLW1jcCJdLCJhdWQiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIiwiY2xpZW50X2lkIjoiMjZiZTZiMDktOTFjNS00N2RhLTk4NjEtZDJkMmJiN2E3ZTM2Iiwic2Vzc2lvbklkIjoiNmE4M2JhMjFhNzA4MTI5N2M3MTFmODUxIiwiaWF0IjoxNzg4MTQwNjEyLCJqdGkiOiJhY2M5OGQ0ZS1hNTc4LTQ2YTgtYWJkMi1kNmUwNzEwYmUyNjMiLCJzdWIiOiI2YTgzYmEyMGE3MDgxMjk3YzcxMWY4NDgiLCJleHAiOjE3OTA3MzI2MTIsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.otDwERBZtwyVZ9MKlSeN3upQehQiq_qnVjo357RJeioLOi7V8GH47TNFK-ZgoLcrLxs_wZaJvsC04UE2oA88Bg\"\n",
26
- "MODEL_ID = \"shreyansh12183/Shreyansh-STEM-AI-7B-Final\"\n",
27
- "\n",
28
- "os.environ[\"HF_TOKEN\"] = HF_TOKEN\n",
29
- "os.environ[\"HUGGING_FACE_HUB_TOKEN\"] = HF_TOKEN\n",
30
- "\n",
31
- "print(\">>> Starting vLLM Engine on GPU...\")\n",
32
- "vllm_cmd = [\n",
33
- " \"python3\", \"-m\", \"vllm.entrypoints.openai.api_server\",\n",
34
- " \"--model\", MODEL_ID,\n",
35
- " \"--served-model-name\", \"shreyansh-stem-7b\",\n",
36
- " \"--port\", \"8000\",\n",
37
- " \"--gpu-memory-utilization\", \"0.92\",\n",
38
- " \"--max-model-len\", \"4096\",\n",
39
- " \"--trust-remote-code\",\n",
40
- " \"--dtype\", \"half\"\n",
41
- "]\n",
42
- "server_proc = subprocess.Popen(vllm_cmd)\n",
43
- "\n",
44
- "# Wait for server to become healthy\n",
45
- "print(\">>> Waiting for weights to mount in VRAM...\")\n",
46
- "for _ in range(60):\n",
47
- " try:\n",
48
- " req = urllib.request.urlopen(\"http://127.0.0.1:8000/v1/models\", timeout=2)\n",
49
- " if req.status == 200:\n",
50
- " print(\">>> \u2705 vLLM Engine is live!\")\n",
51
- " break\n",
52
- " except Exception:\n",
53
- " time.sleep(5)\n",
54
- "\n",
55
- "# Download cloudflared binary\n",
56
- "!wget -q -nc https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64\n",
57
- "!chmod +x cloudflared-linux-amd64\n",
58
- "\n",
59
- "print(\">>> Punching encrypted Cloudflare tunnel...\")\n",
60
- "tunnel_proc = subprocess.Popen(\n",
61
- " [\"./cloudflared-linux-amd64\", \"tunnel\", \"--url\", \"http://127.0.0.1:8000\"],\n",
62
- " stdout=subprocess.PIPE,\n",
63
- " stderr=subprocess.STDOUT,\n",
64
- " text=True\n",
65
- ")\n",
66
- "\n",
67
- "for line in iter(tunnel_proc.stdout.readline, ''):\n",
68
- " if \"trycloudflare.com\" in line:\n",
69
- " match = re.search(r'https://[a-zA-Z0-9-]+\\.trycloudflare\\.com', line)\n",
70
- " if match:\n",
71
- " url = match.group(0)\n",
72
- " print(\"\\n\" + \"=\"*70)\n",
73
- " print(\"\ud83c\udf89 COPY THIS URL INTO NEXTCHAT SETTINGS -> CUSTOM ENDPOINT:\")\n",
74
- " print(f\"{url}\")\n",
75
- " print(\"=\"*70 + \"\\n\")\n",
76
- " break\n",
77
- "\n",
78
- "server_proc.wait()\n"
79
- ]
80
- }
81
- ],
82
- "metadata": {
83
- "accelerator": "GPU",
84
- "colab": {
85
- "provenance": []
86
- },
87
- "language_info": {
88
- "name": "python"
89
- }
90
- },
91
- "nbformat": 4,
92
- "nbformat_minor": 0
93
- }