interlens.participant.serialize¶
interlens.participant.serialize
¶
Persist a participant to / from its own constructor kwargs (for Conversation.save / load).
This is same-type persistence — a participant serializes the recipe it was built from (an HF id + generation
settings, or an API provider + model id) and rebuilds an equivalent lazy participant. It is NOT a conversion to
a separate config type (participants ARE their own recipe now); weights are never serialized and reload lazily on
the target device. private_context (ContextItems) is inlined; local tools are stored by name and
re-resolved from the tool registry on load.
participant_from_dict
¶
Rebuild a (lazy) participant from :func:participant_to_dict output. Local models resolve their family class
from the HF config and load lazily on device; API participants are reconstructed directly.
Source code in src/interlens/participant/serialize.py
participant_to_dict
¶
Serialize participant p to a plain dict of its constructor kwargs (no weights). Dispatches on the
participant kind via duck-typed attributes (a local model participant has hf_id; an API one has
provider).