Connection
Base URL, credentials and a reachable server.
In ByteVesper, connect byte frequencies to probability contributions and a result measured in bits per byte.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
from collections import Counter
from math import log2
def byte_entropy(data):
if not isinstance(data, bytes) or len(data) > 65536:
raise ValueError("bytes.limit")
if not data:
return 0.0
n = len(data)
return sum((count / n) * log2(n / count) for count in Counter(data).values())