Skip to content

Commit 7f73722

Browse files
committed
fixed merge conflicts
2 parents c5555e0 + a1aa2ea commit 7f73722

85 files changed

Lines changed: 2717 additions & 2533 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Research Technology Services @ NYU
22

3+
## Companion repo for examples
4+
Plese add any scripts/code snippets used to [rts-docs-examples](https://github.com/NYU-RTS/rts-docs-examples.git)
5+
36
## Deploy locally:
47
On Linux/Macos run:
58
```
69
curl -fsSL https://pixi.sh/install.sh | bash
710
```
811
or look for alternate methods/platforms [here](https://pixi.sh/latest/#installation).
912

10-
### Build and serve:
13+
### Build and start development server (with live reloading to reflect changes):
1114
```
12-
pixi run serve
15+
pixi run start
1316
```

docs/genai/01_getting_started/01_intro.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ If you're looking to harness Generative AI for administrative or classroom use,
77
Welcome to Pythia, the generative AI platform for research workflows. As part of the Pythia platform, the following capabilities are offered:
88
- [Access to externally hosted LLMs](../02_external_llms/01_llm_access.mdx)
99
- [HPC resources for fine tuning LLMs](../03_llm_fine_tuning/01_intro.md)
10-
- [Milvus vector database](../04_vector_databases/01_intro.md)
1110

1211
:::tip[Personal use]
1312
If you want to access NYU provided LLMs for personal use, proceed to https://gemini.google.com/app with your NYU credentials.

docs/genai/02_external_llms/02_catalogue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We currently facilitate access to the following externally hosted LLMs:
1010
- text-embedding-3-small
1111

1212
## VertexAI
13-
- Gemini-2.5-flash-preview-04-17
13+
- gemini-2.5-flash-preview-05-20
1414
- Gemini-2.0 models (flash, flash-lite)
1515
- Gemini-1.5 models (flash, pro) (deprecated)
1616

docs/genai/05_how_to_guides/01_temperature.md renamed to docs/genai/04_how_to_guides/01_temperature.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Temperature
1+
# Effect of Temperature
22

33
Generating text (or images) from LLMs is inherently probabilistic. However, as an end user you have many parameters at your disposal to tweak the behavior of LLMs. Of these, temperature is the most commonly used. Broadly, it controls the randomness of the generated text. A lower temperature produces more deterministic outputs, while a higher temperature produces more random "creative" output. For a more comprehensive explanation on this topic, refer to the following:
44
- [How to generate text: using different decoding methods for language generation with Transformers](https://huggingface.co/blog/how-to-generate)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Generating embeddings
2+
3+
While Decoder-only LLMs gained massive popularity via their usage in chatbots, Encoder-only LLMs can be used for a wider variety of tasks. Decoder-only LLMs "generate" tokens ("text") one at a time probabalisticsally. Encoder-only LLMs on the other hand take text as their input, tokenize it and generate "embeddings" as their output. Here, we shall walk through a task of generating embeddings from a text snippet.
4+
5+
```mermaid
6+
flowchart LR;
7+
A["natual language text: <br> *GenAI can be used for research*"]
8+
B["encoder-only LLM"]
9+
C["vector embedding <br> [0.052, 0.094, 0.244, ...]"]
10+
A-- "Input" -->B;
11+
B-- "Output" -->C;
12+
```
13+
14+
:::tip
15+
Embeddings have the ability to encode the semantic meaning of the natual language text/images!
16+
:::
17+
18+
The snippet below uses the `text-embedding-3-small` model to create 32-dimensional floating point vector embeddings for the input string:
19+
20+
```python
21+
from portkey_ai import Portkey
22+
23+
portkey = Portkey(
24+
base_url="https://ai-gateway.apps.cloud.rt.nyu.edu/v1/",
25+
api_key="", # Replace with your Portkey API key
26+
virtual_key="", # Replace with your virtual key
27+
)
28+
29+
response = portkey.embeddings.create(
30+
model="text-embedding-3-small",
31+
input="GenAI can be used for research.",
32+
encoding_format="float",
33+
dimensions=32,
34+
)
35+
36+
print(response["data"][0].embedding)
37+
```
38+
39+
and gives the following response:
40+
```
41+
[0.052587852, 0.094195396, 0.24439038, 0.104940414, -0.028921358, -0.31591928, -0.1846261, 0.221018, 0.033215445, -0.1382735, -0.14776362, -0.15058714, 0.057725072, -0.23435123, 0.07956805, -0.32156628, -0.08454841, 0.04066637, -0.022215525, 0.19090058, -0.11160703, 0.22258662, -0.06843088, -0.22854735, 0.1033718, -0.38085997, 0.2933312, -0.023215517, 0.20768477, -0.039333045, 0.17192031, -0.14180289]
42+
```
43+
44+
## Applications of embeddings
45+
46+
Embeddings are typically used for:
47+
- retrieval-augmented generation
48+
- search
49+
- classification
50+
51+
:::info
52+
Embeddings are typically stored in a *vector* database which is designed for efficient storage and fast retrieval of vectors.
53+
:::
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Retrieval-augmented generation
2+
3+
Large Language Models only know about the data they were trained upon and do not have the context needed to be effective at answering questions based on:
4+
- private datasets
5+
- newer knowledge past the cutoff date (i.e. the date at which data collection was frozen)
6+
7+
To get around this issue, one of the most popular techniques is Retrieval-augmented generation, the most basic version of which is outlined below:
8+
9+
```mermaid
10+
flowchart TB;
11+
A["Documents to use in RAG pipeline"]
12+
B@{shape: docs, label: "Document parsed and divided into multiple chunks"}
13+
C["encoder-only LLM"]
14+
D@{shape: procs, label: "text chunk embedding"}
15+
E[("vector database")]
16+
F["natual language prompt"]
17+
G["query embedding"]
18+
I["relevant chunks"]
19+
J["original prompt with added context"]
20+
K["relevant response from LLM using context"]
21+
subgraph Ingestion
22+
A-- "Parse and Chunk" -->B;
23+
end
24+
subgraph Embeddings
25+
B-- "Pass to embedding model" -->C;
26+
C-- "Generate Embeddings" -->D;
27+
D-- "Store Emebddings" -->E;
28+
end
29+
subgraph Retrieval
30+
F-- "Pass to embedding model" -->C;
31+
C-- "Generate Emebddings" -->G;
32+
G-- "Query vector database" -->E;
33+
E-- "Gather text chunks with embeddings similar to prompt" -->I;
34+
end
35+
I-- "With expanded prompt" -->J;
36+
subgraph Augmented Generation
37+
J-- "LLM" -->K;
38+
end
39+
```
40+
41+
It starts with the "Ingestion" phase where a document to be used as context is parsed and broken into chunks. These chunks are then converted to embeddings and stored in a vector database (which specializes in storing and retrieving vectors). This setup allows us now "retrieve" the required context for an incoming prompt before it is sent to an LLM. The "retrieval" phase consists of converting the prompt to an embedding and looking up embeddings for chunks of the document that are similar to it. The text chunks associated with the embeddings similar to the embedding for the query are then added as additional context to the prompt before passing it to an LLM.
42+
The LLM now has the associated context it needs to generate an relevant response to the prompt. Here's a link to a script to test this out yourself, once you have API access to an embedding model and an LLM: https://github.com/NYU-RTS/rts-docs-examples/tree/main/genai/rag .
43+
44+
You can run it to ask a question about a recent event that occurred after the knowledge cutoff for the dataset used to train the LLM:
45+
```sh
46+
ss19980@ITS-JQKQGQQMTX ~/D/p/r/g/rag (main)> uv run rag_basic.py \
47+
https://en.wikipedia.org/wiki/2025_London_Marathon \
48+
"Which athletes won the 2025 London Marathon?"
49+
...
50+
Processing chunks: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 44/44 [00:13<00:00, 3.22it/s]
51+
----------------------------------------------------------------
52+
Query embedding vector (first 5 dims) is: [-0.013783585280179977, 0.022411219775676727, -0.018617955967783928, -0.04355597868561745, -0.009368936531245708]
53+
----------------------------------------------------------------
54+
Retrieved chunks and similarity scores:
55+
56+
('The 2025 London Marathon was the 45th running of the London Marathon; it took place on 27 April 2025.[1][2]', 0.8441829085350037)
57+
('1. ^ Martin, Andy (26 April 2025). "London Marathon 2025: route, runners and everything else you need to know". The Guardian. Retrieved 26 April 2025.\n2. ^ Poole, Harry (26 April 2025). "Will \'greatest\' London Marathon line-ups break records?". BBC News. Retrieved 26 April 2025.\n3. ^ a b c d "2025 London Marathon results". NBC Sports. 27 April 2025. Retrieved 27 April 2025.', 0.837587296962738)
58+
('Venue, 45th London Marathon = London, England. Date, 45th London Marathon = 27 April 2025. Champions, 45th London Marathon = Champions. Men, 45th London Marathon = Sabastian Sawe (2:02:27). Women, 45th London Marathon = Tigst Assefa (2:15:50). Wheelchair men, 45th London Marathon = Marcel Hug (1:25:25). Wheelchair women, 45th London Marathon = Catherine Debrunner (1:34:18). ←\xa020242026\xa0→, 45th London Marathon = ←\xa020242026\xa0→', 0.8032743334770203)
59+
----------------------------------------------------------------
60+
Generated response from LLM without additional context is:
61+
62+
The 2025 London Marathon has not happened yet!
63+
64+
The event typically takes place in **April** each year. We will only know the winners after the race takes place in April 2025.
65+
---------------------------------------------------------------
66+
Generated response from LLM with additional context is:
67+
68+
The athletes who won the 2025 London Marathon are:
69+
70+
* **Men:** Sabastian Sawe
71+
* **Women:** Tigst Assefa
72+
* **Wheelchair men:** Marcel Hug
73+
* **Wheelchair women:** Catherine Debrunner
74+
E20250611 14:32:54.595919 362220 server.cpp:47] [SERVER][BlockLock][] Process exit
75+
ss19980@ITS-JQKQGQQMTX ~/D/p/r/g/rag (main)>
76+
```
File renamed without changes.

docs/genai/04_vector_databases/01_intro.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/genai/04_vector_databases/_category_.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/hpc/01_getting_started/02_getting_and_renewing_an_account.md renamed to docs/hpc/01_getting_started/02_getting_and_renewing_an_account.mdx

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import Tabs from '@theme/Tabs';
2+
import TabItem from '@theme/TabItem';
3+
14
# Getting and Renewing an Account
25

36
[nyu vpn link]: https://www.nyu.edu/life/information-technology/infrastructure/network-services/vpn.html
@@ -25,11 +28,11 @@ NYU HPC clusters and related resources are available to full-time NYU faculty an
2528

2629
## Getting a new account on the NYU HPC clusters
2730

28-
To request an NYU HPC account please log in to [NYU Identity Management service][nyu ims link] and follow the link to "Request HPC account". We have a walkthrough of how to \[request an account through IIQ]. If you are a student, alumni or an external collaborator you need an NYU faculty sponsor.
31+
To request an NYU HPC account please log in to [NYU Identity Management service][nyu ims link] and follow the link to "Request HPC account". We have a walkthrough of how to [request an account through IIQ](03_walkthrough_request_hpc_account.mdx). If you are a student, alumni or an external collaborator you need an NYU faculty sponsor.
2932

3033
## Renewing HPC account
3134

32-
Each year, non-faculty users must renew their HPC account by filling in the account renewal form from the [NYU Identity Management service][nyu ims link]. See [Renewing your HPC account with IIQ](./03_walkthrough_approve_hpc_account_request.md) for a walkthrough of the process.
35+
Each year, non-faculty users must renew their HPC account by filling in the account renewal form from the [NYU Identity Management service][nyu ims link]. See [Renewing your HPC account](05_walkthrough_renew_hpc_account.md) for a walkthrough of the process.
3336

3437
## Information for faculty who sponsor HPC users
3538

@@ -61,13 +64,13 @@ HPC faculty sponsors are expected to:
6164

6265
- Respond promptly to account-related requests from HPC staff
6366

64-
Each year, your sponsored users must renew their account. You will need to approve the renewal by logging into the [NYU Identity Management service][nyu ims link]. We have a [walkthrogh of the approval process here](./03_walkthrough_approve_hpc_account_request.md)
67+
Each year, your sponsored users must renew their account. You will need to approve the renewal by logging into the [NYU Identity Management service][nyu ims link]. We have a [walkthrogh of the approval process here](04_walkthrough_approve_hpc_account_request.md)
6568

6669
## Bulk HPC Accounts for Courses
6770

6871
HPC bulk accounts request is disabled for HPC sponsors.
6972

70-
- If you would like to use JupyterHub for your classes, please don't submit the form below, read \[Jupyter Hub page] instead (the link to an intake form is also there)
73+
- If you would like to use JupyterHub for your classes, please don't submit the form below, read \[Jupyter Hub page]**TODO Add a page for JHub in the Cloud section** instead (the link to an intake form is also there)
7174

7275
- Please fill out this [request form][hpc account request form link for courses] for the course, we'll create HPC accounts for the class per request
7376

@@ -81,7 +84,7 @@ NYU partners (\[look for the list here]) with many state and national facilities
8184

8285
If you are part of collaboration with NYU researcher you need to obtain an **affiliate** status before applying for an NYU HPC account. A full-time NYU faculty member must sponsor a non-NYU collaborator for an affiliate status.
8386

84-
Please see [instructions for affiliate management][affiliate and account management link] (NYU NetID login is required to follow the link). [Please read instructions about sponsoring external collaborators here](./05_hpc_accounts_external_collaborators.md).
87+
Please see [instructions for affiliate management][affiliate and account management link] (NYU NetID login is required to follow the link). [Please read instructions about sponsoring external collaborators here](06_hpc_accounts_external_collaborators.md).
8588

8689

8790
## Access to cluster after Graduation
@@ -97,13 +100,25 @@ If you are not part of a collaboration, your access to cluster will end together
97100

98101
In order to request a new HPC account or renew an expired one, you need to be connected to the NYU VPN if you are working remotely, Please see [instructions on how to install and use the NYU VPN][nyu vpn link]. Linux clients are not officially supported, however we were able to successfully use openVPN client. Here are installation and connection instructions for a debian linux distribution with apt package manager:
99102

100-
```sh
101-
apt-get install openconnect
102-
sudo openconnect -b vpn.nyu.edu
103-
```
104103

105-
_When prompted follow the instructions and provide your netID, password, and authenticate with ('push', 'phone1' or 'sms')_
104+
<Tabs>
105+
<TabItem value="anyconnect" label="anyconnect" default>
106+
- Download the VPN package from [here](https://cdn.shanghai.nyu.edu/sites/default/files/anyconnect-core-linux64-4.10.07061.zip) and unzip the file;
107+
- Type the following command in the Terminal
108+
```sh
109+
sudo sh anyconnect-core-linux64-4.10.07061.sh
110+
```
111+
</TabItem>
112+
<TabItem value="openconnect" label="openconnect">
113+
- Type the following command in the Terminal
114+
```sh
115+
apt-get install openconnect
116+
sudo openconnect -b vpn.nyu.edu
117+
```
118+
- When prompted follow the instructions and provide your netID, password, and authenticate with ('push', 'phone1' or 'sms')
119+
This method was tested on few Linux distributions and settings however is not guaranteeed to work in future.
120+
</TabItem>
121+
</Tabs>
106122

107-
This method was tested on few Linux distributions and settings however is not guaranteeed to work in future.
108123

109124
:::

0 commit comments

Comments
 (0)