In this hands on session we will explore the CLDK and its capabilities with a few real-world examples of using the CLDK and LLMs to build:
- a code summarization tool: See Code Summarization
- a test generation tool: See Test Generation
- a code translation tool: See Code Translation
- Install CLDK and java bindings. Detailed set-up instructions can be found in the CLDK documentation.
- An openrouter API key to access some opensource LLMs. If you don't have an account, you can sign up for free at openrouter.ai/sign-up.
-
First, let's clone this repository and navigate to the directory:
git clone https://github.com/codellm-devkit/cldk-tutorial.git && \ cd cldk-tutorial
-
Next, create a
.env
file in the root directory.touch .env
Log in to your openrouter account and create a new API key.
Fig 2. Generate a name and click "Create"
Copy the API key and paste it into the .env
file as follows:
# .env
OPENROUTER_API=sk-rest-of-your_api_key-here
# Ensure to replace 'sk-rest-of-your_api_key-here' with your actual API key
Finally, let's install the required dependencies. You can do this by running the following command in your terminal:
python3 -m venv .venv
source .venv/bin/activate
pip install -U -r requirements.txt
You have two options to start the Jupyter Notebook server:
-
Using the command line: Run the following command in your terminal:
./.venv/bin/jupyter notebook
This will start the Jupyter Notebook server and open it in your default web browser.
-
Recommended: Using VSCode: From inside the
cldk-tutorial
directory you can open VSCode:code .
This will open the current directory in VSCode. You can then open the Jupyter Notebook files and run them directly from there.
Make sure to select the correct Python interpreter (the one inside the
.venv
directory) in VSCode.
Make sure you deactivate the virtual environment when you are done with the tutorial. You can do this by running the following command in your terminal:
deactivate
This will deactivate the virtual environment and return you to your system's default Python environment.
Join our community on Discord/Github to discuss CLDK and share your experiences with other users:
For any questions, feedback, or suggestions, please contact the authors:
Name | |
---|---|
Rahul Krishna | [email protected] |
Rangeet Pan | [email protected] |
Saurabh Sihna | [email protected] |