Skip to content

Precision enum mismatch between SDK v0.1.18 and server | int8/int16 rejected #99

@ArjunJagdale

Description

@ArjunJagdale

The Precision enum in the SDK and the values accepted by the server are out of sync.

SDK enum values (confirmed via print(list(Precision))):
binary, float16, float32, int16, int8

Server accepted values (from API error message):
binary, float16, float32, int16d, int8d


Result

Precision SDK Server Works?
binary BINARY2 binary pass
float16 FLOAT16 float16 pass
float32 FLOAT32 float32 pass
int16 INT16 int16d fail
int8 INT8 int8d fail

Precision.INT8 and Precision.INT16 pass SDK (Pydantic) validation
but are rejected by the server. int8d and int16d are accepted by
the server but do not exist in the SDK enum — making them unreachable
through the official API.

How i tested?

Run this sanity script to verify:

from endee import Endee, Precision

client = Endee()

# 1. SDK Enum Values
print("=" * 50)
print("SDK Precision enum values:")
for p in Precision:
    print(f"  {p.name} → '{p.value}'")

# 2. Existing Indexes
print("=" * 50)
existing = [idx["name"] for idx in client.list_indexes()["indexes"]]
print(f"Existing indexes: {existing}")

# 3. Test Each Precision
print("=" * 50)
print("Testing each precision against server:")

test_results = {}
for p in Precision:
    index_name = f"_sanity_{p.value}"
    try:
        if index_name not in existing:
            client.create_index(
                name=index_name,
                dimension=4,
                space_type="cosine",
                precision=p
            )
        test_results[p.value] = "PASS"
    except Exception as e:
        test_results[p.value] = f"FAIL: {e}"

for precision, result in test_results.items():
    print(f"  {precision:10}{result}")

# 4. Cleanup
print("=" * 50)
print("Cleaning up sanity indexes...")
for p in Precision:
    index_name = f"_sanity_{p.value}"
    try:
        client.delete_index(index_name)
        print(f"  Deleted: {index_name}")
    except Exception as e:
        print(f"  Could not delete {index_name}{e}")

print("=" * 50)
print("Done.")

What is got -


==================================================
SDK Precision enum values:
  BINARY2 → 'binary'
  FLOAT16 → 'float16'
  FLOAT32 → 'float32'
  INT16 → 'int16'
  INT8 → 'int8'
==================================================
Existing indexes: ['WEBLOADER']
==================================================
Testing each precision against server:
  binary     → PASS
  float16    → PASS
  float32    → PASS
  int16      → FAIL: API Error: Invalid precision. Must be one of: binary, float16, float32, int16d, int8d
  int8       → FAIL: API Error: Invalid precision. Must be one of: binary, float16, float32, int16d, int8d
==================================================
Cleaning up sanity indexes...
  Deleted: _sanity_binary
  Deleted: _sanity_float16
  Deleted: _sanity_float32
  Could not delete _sanity_int16 — Resource Not Found: Index not found
  Could not delete _sanity_int8 — Resource Not Found: Index not found
==================================================
Done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions