Skip to main content

GL AIP — GDP Labs AI Agents Package

Python 3.11-3.13 Code style: black

GL stands for GDP Labs—GL AIP is our AI Agents Package for building, running, and operating agents.

Python SDK and CLI for GL AIP - Connect, configure, and manage AI agents on the GDP Labs AI Agents Package.

Python 3.13 support starts with aip-agents 0.8.59. Due to an issue with Python >=3.13.12, support for that Python version range starts with glaip-sdk 0.8.64. Python 3.12 remains preferable to Python 3.13 where available.

🚀 Quick Start

Installation

Installing glaip-sdk provides both the Python SDK and the aip CLI command in a single package.

# Using pip (recommended)
pip install --upgrade glaip-sdk

# Using uv (fast alternative)
uv tool install glaip-sdk

# Using pipx (CLI-focused, isolated environment)
pipx install glaip-sdk

Requirements: Python 3.11, 3.12, or 3.13

🧪 Development Hooks

From python/glaip-sdk, install the package-level hooks so local commits use the configured checks:

cd python/glaip-sdk
pre-commit install

Optional runtime extras

# Document loader support (PDF on Python 3.11/3.12; DOCX/XLSX on Python 3.11/3.12/3.13)
pip install "glaip-sdk[document-loader]"

# Memory support
pip install "glaip-sdk[memory]"

# Google ADK support
pip install "glaip-sdk[google-adk]"

# Evaluation/testing support (includes upstream gllm-evals)
pip install "glaip-sdk[evals]"

# Skills, including the optional local GL Skill runtime
pip install "glaip-sdk[skills]"

Deprecation notice: glaip-sdk[local] is retained for backward compatibility and will be deprecated in a future release. Prefer focused extras such as glaip-sdk[browser-use] and glaip-sdk[document-loader] for new installations.

google-adk remains optional and is not installed by default. If you installed glaip-sdk with a tool-managed environment, install ADK support into that same environment:

# uv tool-managed install
uv tool install --upgrade "glaip-sdk[google-adk]"

# pipx-managed install
pipx install "glaip-sdk[google-adk]"

# if already installed via pipx
pipx inject glaip-sdk "aip-agents-binary[google-adk]"

Updating: The aip CLI automatically detects your installation method and uses the correct update command:

  • If installed via pip: Uses pip install --upgrade glaip-sdk
  • If installed via uv tool install: Uses uv tool install --upgrade glaip-sdk
  • You can also update manually using the same command you used to install

🐍 Hello World - Python SDK

Perfect for building applications and integrations.

Step 1: Environment Setup

Create a .env file:

# .env
AIP_API_URL=https://your-gl-aip-instance.com
AIP_API_KEY=your-api-key
# Optional rollout control while A0 facade migration remains additive-first
# auto (default): prefer aip_agents.integration, then fall back to legacy modules
# legacy: force legacy aip_agents imports for older local runtimes
# integration: force facade-only imports for rollout smoke checks
GLAIP_SDK_AIP_IMPORT_MODE=auto

Optional: mTLS for HTTPS endpoints

Use these environment variables when your AIP endpoint requires mutual TLS:

  • AIP_MTLS_ENABLED: enable mTLS policy loading (true/false)
  • AIP_MTLS_DEFAULT_PROFILE: optional fallback profile name when URL does not match directly
  • AIP_MTLS_PROFILES_JSON: JSON array of mTLS service profiles

Example:

AIP_MTLS_ENABLED=true
AIP_MTLS_DEFAULT_PROFILE=prod
AIP_MTLS_PROFILES_JSON='[
  {
    "name": "prod",
    "base_url": "https://api.example.com",
    "enabled": true,
    "verify_server_cert": true,
    "certificate_set": {
      "client_cert_path": "/etc/ssl/client.crt",
      "client_key_path": "/etc/ssl/client.key",
      "client_key_password": null,
      "ca_bundle_path": "/etc/ssl/ca-bundle.crt"
    }
  }
]'

Notes:

  • Profile base_url values must be HTTPS and include scheme + host.
  • Matching uses parsed scheme/host/port/path boundaries, not raw string prefixes.
  • If no direct match is found, AIP_MTLS_DEFAULT_PROFILE is used when provided.
  • Invalid mTLS config fails fast with MTLSConfigError; when AIP_MTLS_ENABLED=false, the SDK falls back to normal non-mTLS transport.

Step 2: Basic Python Script

# hello_world.py
from glaip_sdk import Client
import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Initialize client
client = Client()

# Create a simple agent
agent = client.agents.create(
    name="hello-sdk",
    instruction="You are a helpful assistant who responds clearly and concisely."
)

# Run the agent
result = agent.run("Hello world, what's 2+2?")

print(f"Agent response: {result}")

Step 3: Run Your Script

python hello_world.py

Step 4: Advanced Example with Streaming

# streaming_example.py
from glaip_sdk import Client
import os
from dotenv import load_dotenv

load_dotenv()
client = Client()

# Create agent with streaming
agent = client.agents.create(
    name="streaming-agent",
    instruction="You are a helpful assistant. Provide detailed responses."
)

# Stream the response
print("Streaming response:")
client.agents.run_agent(
    agent.id,
    "Explain quantum computing in simple terms",
    verbose=True,
)
print("--- Stream complete ---")

Model Selection For Remote Agents

For deployed remote agents, the SDK now treats model= as a seeded AIP model selector.

from glaip_sdk.agents import Agent
from glaip_sdk.models import OpenAI

seeded_agent = Agent(
    name="seeded-demo",
    instruction="You are helpful.",
    model=OpenAI.GPT_5_NANO,
)

Current remote semantics:

  • model= resolves seeded AIP language models only
  • if no seeded match exists, deployment fails fast
  • there is no silent fallback to tenant-owned models

If you need an exact tenant-owned language model today, use the language-model UUID in model=:

tenant_agent = Agent(
    name="tenant-demo",
    instruction="You are helpful.",
    model="<language-model-uuid>",
)

Current selector forms:

  • model="openai/gpt-5-nano" or model=OpenAI.GPT_5_NANO -> seeded symbolic binding
  • model="<language-model-uuid>" -> exact remote language-model binding

A more human-readable tenant selector may be added later, but it is not part of the current SDK contract.

GL Skill runtime

Select the standalone GL Skill runtime for local execution or SDK deployment:

from glaip_sdk import Agent

agent = Agent(
    name="research-agent",
    instruction="Use attached skills when they apply.",
    model="openai/gpt-4.1-mini",
    skills=["./skills/research"],
    skill_runtime="gl_skill",
)
result = agent.run("Summarize the supplied topic.", local=True)

Install glaip-sdk[skills] first. The default skill_runtime="aip" keeps the prompt-driven Skill tools. Remote gl_skill deployment requires ai-agent-platform 0.2.86+; configure skill_runtime on the Agent, not per run, because per-run runtime overrides are rejected.

agent = Agent(
    name="remote-gl-skill-agent",
    instruction="Use attached skills when they apply.",
    skills=["https://github.com/<org>/<repo>/tree/main/skills/research"],
    skill_runtime="gl_skill",
).deploy()
result = agent.run("Summarize the supplied topic.")

🎉 SDK Success! You're now ready to build AI-powered applications with Python.


💻 Hello World - CLI

Perfect for quick testing and command-line workflows.

Step 1: Configure Connection

# Interactive setup (recommended)
aip configure

Or set environment variables:

export AIP_API_URL="https://your-gl-aip-instance.com"
export AIP_API_KEY="your-api-key"
export GLAIP_SDK_AIP_IMPORT_MODE="auto"

GLAIP_SDK_AIP_IMPORT_MODE is only needed for local-mode compatibility rollouts:

  • auto: default; prefer aip_agents.integration.*, then fall back to legacy modules
  • legacy: force legacy imports when an environment is pinned to older aip-agents-binary builds
  • integration: force facade-only imports for smoke checks and future enforcement

Step 2: Verify Connection

aip status

Step 3: Create & Run Your First Agent

# Create a simple agent
aip agents create --name "hello-cli" --instruction "You are a helpful assistant"

# List agents to get the ID
aip agents list

# Run the agent with input
aip agents run <AGENT_ID> --input "Hello world, what's the weather like?"

🎉 CLI Success! You're now ready to use the CLI for AI agent workflows.

✨ Key Features

  • 🤖 Agent Management: Create, run, and orchestrate AI agents with custom instructions and streaming
  • 🧠 Language Models: Choose from multiple AI models per agent with manual PII tag mapping
  • 🛠️ Tool Integration: Extend agents with custom Python tools and script management
  • 🔌 MCP Support: Connect external services through Model Context Protocols with tool discovery
  • 🔄 Multi-Agent Patterns: Hierarchical, parallel, sequential, router, and aggregator patterns
  • 🎙️ Audio Interface (beta): Local-only LiveKit voice sessions for talking to agents (install with glaip-sdk[audio])
  • 💻 Modern CLI: Rich terminal interface with fuzzy search and multiple output formats

🎙️ Local Voice (LiveKit, Beta)

You can run a local voice loop that joins a LiveKit room, transcribes your speech, routes text into an agent, and speaks the reply back.

Prerequisites

  • LiveKit server running (monorepo dev: make -C python/aip-agents livekit-up)
  • LiveKit Meet open in browser (monorepo dev: make -C python/aip-agents livekit-meet-open)
  • OPENAI_API_KEY set (used by livekit-plugins-openai for STT/TTS)

Monorepo Demo Sequence

# One-time install
make -C python/aip-agents install-audio

# Terminal 1: LiveKit server
make -C python/aip-agents livekit-up

# Terminal 2: Join with browser (enable mic)
make -C python/aip-agents livekit-meet-open

# Terminal 3: Run agent (recommended: debug logs)
AIP_AUDIO_DEBUG=1 make -C python/aip-agents audio-agent-up

# Optional: validate join/disconnect (no browser, no mic)
make -C python/aip-agents livekit-smoke-join

Tip: If STT shows odd fragments, it's often speaker-to-mic echo; use headphones.

Example .env values for the repo defaults:

LIVEKIT_URL=ws://localhost:7880
LIVEKIT_API_KEY=devkey
LIVEKIT_API_SECRET=devsecretdevsecretdevsecretdevsecret
LIVEKIT_ROOM_NAME=aip-audio-demo
OPENAI_API_KEY=...

Install

pip install "glaip-sdk[audio]"

Run the SDK example

From the repo:

cd python/glaip-sdk
poetry install --extras "audio"
poetry run python examples/sdk/05_audio_session.py

More details:

  • python/glaip-sdk/gitbook/guides/audio-interface.md
  • python/glaip-sdk/examples/sdk/livekit-local-dev.md

🌳 Live Steps Panel

The CLI steps panel now streams a fully hierarchical tree so you can audit complex agent runs without leaving the terminal.

  • Renders parent/child relationships with │├└ connectors, even when events arrive out of order
  • Marks running steps with spinners and duration badges sourced from SSE metadata before local fallbacks
  • Highlights failures inline (✗ reason) and raises warning glyphs on affected delegate branches
  • Derives deterministic “💭 Thinking…” spans before/after each delegate or tool action to show scheduling gaps
  • Flags parallel work with a dedicated glyph and argument-derived labels so simultaneous tool calls stay readable
  • Try it locally: poetry run python scripts/replay_steps_log.py --transcript tests/fixtures/rendering/transcripts/parallel_research.jsonl --output /tmp/parallel.log

📚 Documentation

📖 Complete Documentation - Visit our GitBook for comprehensive guides, tutorials, and API reference.

Quick links:

🧪 Simulate the Update Notifier

Need to verify the in-session upgrade flow without hitting PyPI or actually running pip install? Use the bundled helper:

cd python/glaip-sdk
poetry run python scripts/mock_update_notifier.py
# or customize the mock payload:
# poetry run python scripts/mock_update_notifier.py --version 3.3.3 --marker "[nightly build]"

The script:

  • Launches a SlashSession with prompt-toolkit disabled (so it runs cleanly in tests/CI).
  • Forces the notifier to believe a newer version exists (--version 9.9.9 by default).
  • Appends a visible marker (default [mock update]) to the banner so you can prove the branding reload happened; pass --marker "" to skip.
  • Auto-selects “Update now”, mocks the install step, and runs the real branding refresh logic.
  • Resets module metadata afterwards so your environment remains untouched.

You should see the Rich banner re-render with the mocked version (and optional marker) at the end of the run.

Metadata

Release files for glaip-sdk 0.9.12.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glaip-sdk 0.9.12.post1
File Size Uploaded
glaip_sdk-0.9.12.post1.tar.gz 719.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for glaip-sdk 0.9.12.post1
File Interpreter ABI Platform
glaip_sdk-0.9.12.post1-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / glaip_sdk-0.9.12.post1.tar.gz

Download URL glaip_sdk-0.9.12.post1.tar.gz
Size 719.8 kB
Tags Source
SHA-256 checksum
How to use checksums
921322b5b526b484e481a503982ca13021d831684d9122243220e86d0dfe7a13
BLAKE2b-256 checksum
How to use checksums
19289ee32020489f87e9e5d8afee53d174f9114eafb3ba7df578a96b824602bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via poetry/2.1.4 CPython/3.12.0 Linux/5.10.0-32-cloud-amd64

Release files / glaip_sdk-0.9.12.post1-py3-none-any.whl

Download URL glaip_sdk-0.9.12.post1-py3-none-any.whl
Size 852.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd74dbe6493fdbf4350917ad7dae2d300cf8080ee06f27f0ff8b7f2147aebd56
BLAKE2b-256 checksum
How to use checksums
04aece47fe5e0b98113f7bf98953306a5d5de119ea051e94ad260ed3dbfb399e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via poetry/2.1.4 CPython/3.12.0 Linux/5.10.0-32-cloud-amd64

Release history Release notifications | RSS feed

This release

0.9.12.post1 This release

2 release files

0.9.11

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.8.66

2 release files

0.8.63

2 release files

0.8.62

2 release files

0.8.61

2 release files

0.8.60

2 release files

0.8.59

2 release files

0.8.58

2 release files

0.8.57

2 release files

0.8.56

2 release files

0.8.55

2 release files

0.8.54

2 release files

0.8.53

2 release files

0.8.52

2 release files

0.8.51

2 release files

0.8.50

2 release files

0.8.46

2 release files

0.8.45

2 release files

0.8.44

2 release files

0.8.43

2 release files

0.8.42

2 release files

0.8.40

2 release files

0.8.34

2 release files

0.8.33

2 release files

0.8.32

2 release files

0.8.30

2 release files

0.8.29

2 release files

0.8.27

2 release files

0.8.25

2 release files

0.8.24

2 release files

0.8.23

2 release files

0.8.20

1 release file

0.8.19

1 release file

0.8.18

1 release file

0.8.17

1 release file

0.8.16

1 release file

0.8.15

1 release file

0.8.14

1 release file

0.8.13

1 release file

0.8.12

1 release file

0.8.11

1 release file

0.8.10

1 release file

0.8.9

1 release file

0.8.8

1 release file

0.8.7

1 release file

0.8.6

1 release file

0.8.5

1 release file

0.8.4

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.42

1 release file

0.7.41

1 release file

0.7.40

1 release file

0.7.39

1 release file

0.7.38

1 release file

0.7.37

1 release file

0.7.36

1 release file

0.7.35

1 release file

0.7.34

1 release file

0.7.33

1 release file

0.7.32

1 release file

0.7.31

1 release file

0.7.30

1 release file

0.7.29

1 release file

0.7.28

1 release file

0.7.27

1 release file

0.7.26

1 release file

0.7.25

1 release file

0.7.24

1 release file

0.7.23

1 release file

0.7.22

1 release file

0.7.21

1 release file

0.7.20

1 release file

0.7.19

1 release file

0.7.18

1 release file

0.7.17

1 release file

0.7.16

1 release file

0.7.15

1 release file

0.7.14

1 release file

0.7.13

1 release file

0.7.12

1 release file

0.7.11

1 release file

0.7.10

1 release file

0.7.9

1 release file

0.7.8

1 release file

0.7.7

1 release file

0.7.6

1 release file

0.7.5

1 release file

0.7.4

1 release file

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.26

1 release file

0.6.25

1 release file

0.6.24

1 release file

0.6.23

1 release file

0.6.22

1 release file

0.6.21

1 release file

0.6.20

1 release file

0.6.19

1 release file

0.6.18

1 release file

0.6.17

1 release file

0.6.16

1 release file

0.6.15

1 release file

0.6.14

1 release file

0.6.12

1 release file

0.6.11

1 release file

0.6.10

1 release file

0.6.9

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.5

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page