> For the complete documentation index, see [llms.txt](https://docs.zama.org/concrete-ml/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/concrete-ml/1.5/getting-started/cloud.md).

# Inference in the cloud

Concrete ML models and data-frames can be easily deployed in a client/server setting, enabling the creation of privacy-preserving services in the cloud.

As seen in the [concepts section](/concrete-ml/1.5/getting-started/concepts.md), once compiled to FHE, a Concrete ML model or data-frame generates machine code that execute prediction, training or pre-processing on encrypted data. *Secret* encryption keys are needed so that the user can securely encrypt their data and decrypt the execution result. An *evaluation* key is also needed for the server to securely process the user's encrypted data.

Keys are generated by the user *once* for each service they use, based on the model the service provides and its cryptographic parameters.

The overall communications protocol to enable cloud deployment of machine learning services can be summarized in the following diagram:

![](https://2241057372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTeFWUaIKrKiFj6iYvz8W%2Fuploads%2Fgit-blob-98dd1e7c0dcb71b807582e66439445e0bbbdd2e8%2FClientServerDiag.png?alt=media)

The steps detailed above are:

1. The model developer deploys the compiled machine learning model to the server. This model includes the cryptographic parameters. The server is now ready to provide private inference. Crypto-graphic parameters and compiled programs for data-frames are included directly in Concrete ML.
2. The client requests the cryptographic parameters (also called "client specs"). Once it receives them from the server, the *secret* and *evaluation* keys are generated.
3. The client sends the *evaluation* key to the server. The server is now ready to accept requests from this client. The client sends their encrypted data. Serialized data-frames include client evaluation keys.
4. The server uses the *evaluation* key to securely run prediction, training and pre-processing on the user's data and sends back the encrypted result.
5. The client now decrypts the result and can send back new requests.

For more information on how to implement this basic secure inference protocol, refer to the [Production Deployment section](/concrete-ml/1.5/guides/client_server.md) and to the [client/server example](https://github.com/zama-ai/concrete-ml/blob/release/1.5.x/docs/advanced_examples/ClientServer.ipynb). For information on training on encrypted data, see [the corresponding section](/concrete-ml/1.5/built-in-models/training.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zama.org/concrete-ml/1.5/getting-started/cloud.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
