Skip to main content

Python SDK - Installation

Requirements

  • Python 3.11+
  • pip

Install

pip install solvec --pre
# Or with uv
uv add solvec --prerelease=allow
Get your API key at app.veclabs.xyz, then:
# Get your API key at app.veclabs.xyz
from solvec import SolVec

sv = SolVec(api_key="vl_live_...")
collection = sv.collection("my-collection", dimensions=1536)
VecLabs manages your Solana wallet, Shadow Drive storage, and Merkle root posting automatically.

Self-hosted mode

Bring your own Solana wallet and manage your own storage:
from solvec import SolVec, SolanaConfig

# Automatic wallet generation
sv = SolVec(network="devnet")

# Or bring your own wallet
sv = SolVec(
    solana=SolanaConfig(
        enabled=True,
        network="devnet",
        keypair="~/.config/solana/id.json",
    )
)

Verify installation

from solvec import SolVec

sv = SolVec(api_key="vl_live_...")
collection = sv.collection("test", dimensions=4)

collection.upsert([{
    "id": "test_001",
    "values": [0.1, 0.2, 0.3, 0.4],
    "metadata": {"text": "Installation test"}
}])

results = collection.query(vector=[0.1, 0.2, 0.3, 0.4], top_k=1)
print("Installation successful:", results[0].id)
# → Installation successful: test_001