Skip to main content

client server for usage with snowglobe experiments

Reason this release was yanked:

mistakenly merged

Project description

Snowlgobe Connect SDK

The Snowglobe Connect SDK helps you connect your AI agents to Snowglobe. It sends simulated user messages to your LLM-based application during experiments. Your application should process these messages and return a response, enabling simulated conversations and custom code based risk assessment.

Installation

# Install client
pip install snowglobe

If using uv, set the --prerelease=allow flag

uv pip install --prerelease=allow snowglobe

snowglobe commands

snowglobe login  # Sets up your API key
snowglobe init  # Initializes a new agent connection and creates an agent wrapper file
snowglobe test  # Tests your agent connection
snowglobe start  # Starts the process of processing simulated user messages
snowglobe --help

When using one of our specific preview environments in .snowgloberc one can override our server's URL with:

CONTROL_PLANE_URL=

Sample custom llm usage in agent wrapper file

Each agent wrapper file resides in the root directory of your project, and is named after the agent (e.g. My Agent Name becomes my_agent_name.py).

from snowglobe.client import CompletionRequest, CompletionFunctionOutputs
from openai import OpenAI
import os

client = OpenAI(api_key=os.getenv("SNOWGLOBE_API_KEY"))

def completion_fn(request: CompletionRequest) -> CompletionFunctionOutputs:
    """
    Process a scenario request from Snowglobe.
    
    This function is called by the Snowglobe client to process requests. It should return a
    CompletionFunctionOutputs object with the response content.

    Example CompletionRequest:
    CompletionRequest(
        messages=[
            SnowglobeMessage(role="user", content="Hello, how are you?", snowglobe_data=None),
        ]
    )

    Example CompletionFunctionOutputs:
    CompletionFunctionOutputs(response="This is a string response from your application")
    
    Args:
        request (CompletionRequest): The request object containing the messages.

    Returns:
        CompletionFunctionOutputs: The response object with the generated content.
    """

    # Process the request using the messages. Example:
    messages = request.to_openai_messages()
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=messages
    )
    return CompletionFunctionOutputs(response=response.choices[0].message.content)

Operator tuning

The wrapper exposes ~12 environment variables for concurrency, inbound rate limits, polling cadence, and HTTP retry. Defaults are tuned for low-to-medium throughput; raise them together (not individually) for higher load.

See .snowglobe/TUNING.md for the full knob reference, recipes, and the ratio caveat between dispatch concurrency and the inbound rate limiter.

Tracing & Telemetry

See our telemetry instrumentation extensions for snowglobe to help you track insightful traces from our agent:

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snowglobe-1.0.0.tar.gz (146.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snowglobe-1.0.0-py3-none-any.whl (106.4 kB view details)

Uploaded Python 3

File details

Details for the file snowglobe-1.0.0.tar.gz.

File metadata

  • Download URL: snowglobe-1.0.0.tar.gz
  • Upload date:
  • Size: 146.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for snowglobe-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7088df14439b51d337acd71a6d72793a678d0ffaa67213eb9387f04e013a93e1
MD5 878b49de207624e6b53e722ce0566c8f
BLAKE2b-256 9cd287caf2433c191744d38c187a0a23704e3d957254fb1c7c1dc1802732fc0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for snowglobe-1.0.0.tar.gz:

Publisher: release.yml on guardrails-ai/client_wrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snowglobe-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: snowglobe-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 106.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for snowglobe-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af8f93febad358436cc04baedb4b1a58677ea071eeeee4de66997806efbbb9b8
MD5 aa9b11c50ed2a478523d6116d5d065cd
BLAKE2b-256 65e5d38d07ecaed1f491ff17694a12ec52ac256ada08f1b73e9c1cfd3ef0ab24

See more details on using hashes here.

Provenance

The following attestation bundles were made for snowglobe-1.0.0-py3-none-any.whl:

Publisher: release.yml on guardrails-ai/client_wrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page