# Serialize and Deserialize SchemeSwitching in openfhe-python

**URL:** <https://openfhe.discourse.group/t/serialize-and-deserialize-schemeswitching-in-openfhe-python/2277>\
**Category:** Library Questions\
**Tags:** openfhe-help\
**Created:** [February 12, 2026, 6:18am UTC](https://openfhe.discourse.group/t/serialize-and-deserialize-schemeswitching-in-openfhe-python/2277 "2026-02-12T06:18:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![div](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@div](https://openfhe.discourse.group/u/div)\
**Post date:** [February 12, 2026, 6:18am UTC](https://openfhe.discourse.group/t/serialize-and-deserialize-schemeswitching-in-openfhe-python/2277/1 "2026-02-12T06:18:38Z")

</div>

Dear Team,

For the scheme-switching.py example mentioned on the github repository of openfhe python, I want to replicate it in form of client server environment. This requires serialization. Now I have serialized cryptoContext, EvalMultKey and EvalAutomorphismKey. But I am not able to serialize and schemeSwitchingKey. Without serializing it, I get the following error on server after I try of deserialize the keys execute the command. Can you guide me on how to serialize this here?

RuntimeError: /root/openfhe-python-packager/build/openfhe-development/src/pke/lib/scheme/ckksrns/ckksrns-schemeswitching.cpp:l.1187:EvalSlotsToCoeffsSwitch(): Precomputations for 128 slots were not generated Need to call EvalCKKSToFHEWPrecompute to proceed

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [March 2, 2026, 12:18pm UTC](https://openfhe.discourse.group/t/serialize-and-deserialize-schemeswitching-in-openfhe-python/2277/2 "2026-03-02T12:18:49Z")

</div>

I suggest looking at the following (C++) example: [openfhe-development/src/pke/examples/scheme-switching-serial.cpp at v1.5.0 · openfheorg/openfhe-development · GitHub](https://github.com/openfheorg/openfhe-development/blob/v1.5.0/src/pke/examples/scheme-switching-serial.cpp) along with the (Python) examples of scheme switching without parallelization: [openfhe-python/examples/pke/scheme-switching.py at v1.5.0.0 · openfheorg/openfhe-python · GitHub](https://github.com/openfheorg/openfhe-python/blob/v1.5.0.0/examples/pke/scheme-switching.py). Same functions are exposed through the Python interface. For instance, you can add `EvalCKKStoFHEWPrecompute` as suggested by the exception.
