GL SDK

What is GL SDK?

GL SDK is a meta package for GenAI, BOSA, and many more. It acts as a centralized installer for the entire GL SDK family.

Prerequisites

If you want to try the snippet code in this page:

Installation

# you can use a Conda environment
pip install --extra-index-url https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/ "gl-sdk"

Using A Library in GL SDK

1

Create a script called main.py:

import asyncio
from gllm_inference.lm_invoker import OpenAILMInvoker

# Initialize the language model
lm_invoker = OpenAILMInvoker("gpt-4.1-nano")

# Send a prompt and get a response
response = asyncio.run(lm_invoker.invoke([("user", ["What is the capital city of Indonesia?"])]))

print(f"Response: {response}")
2

Run the script:

python main.py
3

The script will generate the following output:

[01/08/2025 16:01:38.661 OpenAILMInvoker INFO] Invoking 'OpenAILMInvoker'
[01/08/2025 16:01:40.814 httpx INFO] HTTP Request: POST https://api.openai.com/v1/responses "HTTP/1.1 200 OK"
Response: The capital city of Indonesia is Jakarta.

Extras

By default, if you install GL SDK you will get gllm-core and gllm-inference.

To keep the installation lean, GL SDK provides several extras. So you don't have to install libraries you don't need:

  1. genai = gllm-privacy, gllm-datastore, gllm-misc, gllm-docproc, gllm-retrieval, gllm-generation, gllm-pipeline, gllm-rag

  2. agent = gllm-agent, gllm-agents

  3. bosa = bosa-core, bosa-connectors

  4. eval = gllm-evals

You can install the extras as follows:

# you can use a Conda environment
pip install --extra-index-url https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/ "gl-sdk[genai, agent]"

Last updated