Skip to content

Quick start

Valkey GLIDE is the open-source client library for Valkey. Designed for performance and consistency between supported languages. This guide will show how to quickly install and set up a simple development environment for Valkey GLIDE.

GLIDE provides two main client types:

  • GlideClient: For standalone Valkey instances.
  • GlideClusterClient: For cluster deployments.

For this guide, we will use a standalone client to connect to a Valkey Docker instance.

  1. Follow the instructions on the Docker website to install Docker for your operating system.

  2. Start a local Valkey server:

    Terminal window
    # Pull and run Valkey server
    docker run -d --name valkey-server -p 6379:6379 valkey/valkey:latest
    # Verify it's running
    docker ps
  3. Verify connection with Valkey server:

    Terminal window
    docker exec valkey-server valkey-cli ping
    # Expected output: PONG
  • Ubuntu 20 (x86_64/amd64 and arm64/aarch64)
  • Amazon Linux 2 (AL2) and 2023 (AL2023) (x86_64)
  • macOS 14.7 (Apple silicon/aarch_64)
  • macOS 13.7 (x86_64/amd64)

Requirements: Python 3.9 to 3.13.

Terminal window
# Install the latest version
pip3 install valkey-glide

The following code snippet performs a simple “ping” command to our docker Valkey instance. This will tell us that GLIDE was able to send and receive commands from Valkey. For testing against a live instance, update the GlideClient configurations.

import asyncio
from glide import GlideClient, NodeAddress
async def main():
# Create client configuration
client = GlideClient([NodeAddress("localhost", 6379)])
try:
# Test the connection
response = await client.ping()
# Valkey responds with PONG
print(f"Connected! Server responded: {response}")
except Exception as e:
print(f"Connection failed: {e}")
finally:
# Always close the client
await client.close()
# Run the async function
if __name__ == "__main__":
asyncio.run(main())

Running the above snippet should give you this response.

Terminal window
Connected! Server responded: PONG

GLIDE offers many configuration options to connect to Valkey through its configuration objects. These options, and other interfaces, stay consistent between languages.

# Setting up connection configuration
config = GlideClientConfiguration(
addresses=[NodeAddress("localhost", 6379)],
# Connection timeout (milliseconds)
request_timeout=5000,
# Connection pool size
connection_backoff_max_delay=1000,
# TLS configuration (if needed)
use_tls=False,
# Database selection (0-15 for Redis/Valkey)
database_id=0
)

Congratulations, you are now connected to Valkey using GLIDE! To see how to make basic operations take a look at the our guide.