Skip to content

REST API

Gilial provides REST endpoints for compression operations.

http://localhost:8000

(or your deployed endpoint)

Get current index statistics.

Response:

{
"index_name": "your-index",
"environment": "us-west-1",
"total_vector_count": 10000,
"dimension": 768,
"namespaces": {}
}

Example:

Terminal window
curl http://localhost:8000/status

Estimate compression savings.

Query Parameters:

  • strategy (optional): "balanced" or "aggressive" (default: "balanced")

Response:

{
"original_vectors": 10000,
"compressed_vectors": 9739,
"original_size_mb": 29.30,
"compressed_size_mb": 28.53,
"savings_pct": 2.61,
"compression_ratio": 0.974
}

Example:

Terminal window
curl "http://localhost:8000/estimate?strategy=balanced"

Compress vectors (dry-run or apply).

Request Body:

{
"strategy": "balanced",
"dry_run": true
}

Parameters:

  • strategy (str): "balanced" or "aggressive" (default: "balanced")
  • dry_run (bool): Preview only (default: true)

Response:

{
"strategy": "balanced",
"original_vectors": 10000,
"compressed_vectors": 9739,
"original_size_mb": 29.30,
"compressed_size_mb": 28.53,
"dry_run": false,
"savings_pct": 2.61,
"metadata": {
"deleted_vectors": 261
}
}

Example - Dry-Run:

Terminal window
curl -X POST http://localhost:8000/compress \
-H "Content-Type: application/json" \
-d '{"strategy": "balanced", "dry_run": true}'

Example - Apply:

Terminal window
curl -X POST http://localhost:8000/compress \
-H "Content-Type: application/json" \
-d '{"strategy": "balanced", "dry_run": false}'
Terminal window
python backend/main.py

Server starts at http://localhost:8000

No built-in rate limits. Recommended:

  • Limit compression runs to once per hour
  • Run during off-peak times
  • Use dry-run before applying changes