> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cyborg.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Client

`Client` is the main class exposed by `cyborg_vector_search_py`. It exposes the functionality necessary to create, load, list and delete indexes. Operations within encrypted indexes (such as `upsert` and `query`) are contained within the `EncryptedIndex` class returned by `create_index` and `load_index`.

## Constructor

```python theme={null}
Client(index_location: DBConfig,
       config_location: DBConfig,
       items_location: DBConfig,
       cpu_threads: int = 0,
       gpu_accelerate: bool = False)
```

Initializes a new Cyborg Vector Search `Client` instance.

### Parameters

| Parameter         | Type                            | Default | Description                                                                                                             |
| ----------------- | ------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------- |
| `index_location`  | [`DBConfig`](../types#dbconfig) | -       | Configuration for index storage location. Use a dictionary with keys `location`, `table_name`, and `connection_string`. |
| `config_location` | [`DBConfig`](../types#dbconfig) | -       | Configuration for index metadata storage. Uses the same dictionary structure as `index_location`.                       |
| `items_location`  | [`DBConfig`](../types#dbconfig) | `NONE`  | *(Optional)* Configuration for encrypted item storage. Uses the same dictionary structure as `index_location`.          |
| `cpu_threads`     | `int`                           | `0`     | *(Optional)* Number of CPU threads to use for computations (defaults to `0` = all cores).                               |
| `gpu_accelerate`  | `bool`                          | `False` | *(Optional)* Indicates whether to use GPU acceleration (defaults to `False`).                                           |

### Exceptions

<AccordionGroup>
  <Accordion title="ValueError">
    * Throws if the `cpu_threads` parameter is less than `0`.
    * Throws if any [`DBConfig`](../types#dbconfig) is invalid.
    * Throws if the GPU is not available when `gpu_accelerate` is `True`.
  </Accordion>

  <Accordion title="RuntimeError">
    * Throws if the backing store is not available.
    * Throws if the Client could not be initialized.
  </Accordion>
</AccordionGroup>

### Example Usage

```python theme={null}
import cyborg_vector_search_py as cvs

index_location = cvs.DBConfig(location='redis', connection_string="redis://localhost")
config_location = cvs.DBConfig(location='redis', connection_string="redis://localhost")
items_location = cvs.DBConfig(location='postgres', table_name="items", connection_string="host=localhost dbname=postgres")

# Construct the Client object
client = cvs.Client(index_location=index_location,
                    config_location=config_location,
                    items_location=items_location,
                    cpu_threads=4,
                    gpu_accelerate=True)

# Proceed with further operations
```
