> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/sdks/backend-sdk/ocr/technical_documentation/technical_specifications.md).

# Technical specifications

The web service starts with a thread. Each thread handles documents in single-threaded mode, which means it can only process one request at a time. The number of threads is limited by the available hardware resources. Therefore, if many requests are sent at once, they are queued and processed one by one.

## 1. Considerations

The request processing speed depends on:

* The image quality.
* The CPU performance.
* The CPU allocation per worker. The query stages are intrinsically parallelized, so a worker with 4 CPUs will execute the request faster compared to a worker with only 1 CPU.

### 1.1 Image requirements

To provide the best possible result, it is necessary that the submitted images meet the following requirements:

* The minimum image quality is 720p, 100dpi. You must always maintain the correct aspect ratio.
* The `Invoices` must be in **A4 format**.
* For correct document detection, it is recommended that the image have good contrast between the background and the document and that the document's four corners are visible.

## 2. Hardware requirements

|         | Minimum requirement                                           | Recommended requirement       |
| ------- | ------------------------------------------------------------- | ----------------------------- |
| CPU     | 4-core CPU compatible with the SSE4.2 instruction set, >=2GHz | 8 cores, compatible with AVX2 |
| RAM     | 4 GB                                                          | 8 GB                          |
| Disk    | 4 GB                                                          | 4 GB SSD                      |
| Network | 100 Mbps                                                      | 1 Gbps                        |

## 3. Software requirements

* Docker 24.0 or higher, or compatible software.

## 4. Performance statistics

The following figure shows the performance statistics obtained in **Facephi OCR Service**, in terms of times obtained in the following modules:

* IdCard
* Invoice

To carry out the measurements of OCR extraction and interpretation, a device with the following characteristics was used:

* Intel(R) Xeon(R) Platinum 8275CL CPU 3.00GHz
* 16-core processor
* 32Gb RAM

Please note the following:

* The images are 1080p.
* Only one image per type.
* The invoices (Invoice) are full images, but cropped by our SDK.

|             | IdCard | Invoice |
| ----------- | ------ | ------- |
| Performance | 770 ms | 3100 ms |

## 5. Security considerations

* Keep `auth_jwt_secret` it in a secrets store or inject it via an environment variable, instead of including it directly in the container images.
* Optional JWT authentication is configured at startup from `config.json` or from the environment variables `FACEPHI_OCR_REST_AUTH_*`.
* When JWT is enabled, `GET /api/v1/version` and `GET /api/v1/health` remain public, while the rest of the endpoints require a valid JWT.
* `GET /api/v1/config` never exposes the JWT startup configuration and `POST /api/v1/config` cannot modify it.
