This directory contains Jupyter notebooks demonstrating how to use the various components of the LangGate SDK.
We recommend using these notebook examples for an interactive exploration of the SDK:
- registry_example.ipynb: Using the
LocalRegistryClient
to get model information - transformer_example.ipynb: Using the
LocalTransformerClient
for parameter transformation - combined_example.ipynb: Using the combined
LangGateLocal
for both functionality - langchain_examples.ipynb: Integrating LangGate with Langchain
- http_client_example.ipynb: Using the
HTTPRegistryClient
to connect to a remote LangGate service - custom_clients.ipynb: Creating custom clients with LangGate
Make sure you have LangGate installed:
Using uv:
# Install the full SDK
uv add langgate[all]
# Or install just what you need
uv add langgate[registry] # For registry examples
uv add langgate[transform] # For transformer examples
uv add langgate[sdk] # For combined client examples
uv add langgate[client] # For HTTP client examples
Using pip:
# Install the full SDK
pip install langgate[all]
# Or install just what you need
pip install langgate[registry] # For registry examples
pip install langgate[transform] # For transformer examples
pip install langgate[sdk] # For combined client examples
pip install langgate[client] # For HTTP client examples
The examples expect a valid langgate_config.yaml
file in the current directory. A minimal example config would look like:
# Global default parameters
default_params:
temperature: 0.7
# Service provider configurations
services:
anthropic:
api_key: "${ANTHROPIC_API_KEY}"
base_url: "https://api.anthropic.com"
# Model-specific configurations
models:
- id: anthropic/claude-3-7-sonnet
service:
provider: anthropic
model_id: claude-3-7-sonnet-20250219
See the main documentation for full configuration details and parameter options.