After upgrading leptonai, from leptonai.api.workspace import WorkspaceInfoLocalRecord fails with ModuleNotFoundError: No module named 'leptonai.api.workspace'. It worked in the previous version. Where did it move?
The old API module was moved, not removed. Update your import to from leptonai.api.v0.workspace import WorkspaceInfoLocalRecord and it will work. If you want the new style API instead, use from leptonai.api.v1.client import APIClient, then c.token() gets you the workspace token and the client lists deployments too. Alternatively pinning leptonai==0.21.3 keeps the old path working as a quick fix. Source: https://github.com/leptonai/leptonai/issues/481