TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Swap between local and cloud execution with a Python decorator

4 pointsby lebovicover 2 years ago

1 comment

lebovicover 2 years ago
Hey HN! I wanted a way to quickly switch between local and cloud execution for prototyping, so we built Lug. Notably, Lug doesn&#x27;t require you to define your dependencies; it tries to extract and rebuild the same environment automatically. That means the decorator can literally just start as &quot;@lug.hybrid(cloud=True)&quot;.<p>In the background, a new instance is spun up for every request. That means this has a high cold-start time, so is best for longer functions. I use it for computational biology (which contains some ML) batch processing.<p>You can also switch between cloud environments with the &quot;provider&quot; argument, but it&#x27;s limited to just a couple options right now. We use it to cycle between AWS and our on-prem servers depending on capacity.