I'm currently running a Discord bot with a 7B model off a free Oracle Ampere instance with their Pytorch Accelerated[0] image. It's not terribly fast, but totally usable for group chats that want to interrogate an AI. If you're doing some sort of offline processing or non-time-imperative operation, something like this might be worth looking into. [0] https://cloudmarketplace.oracle.com/marketplace/en_US/adf.ta...
Ask HN: What do you use for ML Hosting?
11–20 of 69 posts
Re: Ask HN: What do you use for ML Hosting?
#12I'm at erik@banana.dev if you want any help with it :)
Re: Ask HN: What do you use for ML Hosting?
#13Re: Ask HN: What do you use for ML Hosting?
#14Re: Ask HN: What do you use for ML Hosting?
#15Re: Ask HN: What do you use for ML Hosting?
#16They’ll take a FastAPI setup too and just put it online to be used on demand.
Re: Ask HN: What do you use for ML Hosting?
#17Re: Ask HN: What do you use for ML Hosting?
#18 import modal
def download_model():
from transformers import pipeline
pipeline("fill-mask", model="bert-base-uncased")
CACHE_PATH = "/root/model_cache" # model location in image
ENV = modal.Secret({"TRANSFORMERS_CACHE": CACHE_PATH})
image = (
modal.Image.debian_slim()
.pip_install("torch", "transformers")
.run_function(download_model, secret=ENV)
)
stub = modal.Stub(name="hn-demo", image=image)
class Model:
def __enter__(self):
from transformers import pipeline
self.model = pipeline("fill-mask", model="bert-base-uncased", device=0)
@stub.function(
gpu="a10g",
secret=ENV,
)
def handler(self, prompt: str):
return self.model(prompt)
if __name__ == "__main__":
with stub.run():
prompt = "Hello World! I am a [MASK] machine learning model."
print(Model().handler.call(prompt)[0]["sequence"])
Running `python hn_demo.py` prints "Hello World! I am a simple machine learning model."You can check out available GPUs at https://modal.com/docs/reference/modal.gpu.
There's also a bunch of easy-to-run examples in our docs :) https://modal.com/docs/guide/ex/stable_diffusion_cli
Re: Ask HN: What do you use for ML Hosting?
#19Hey! Would love to have you try https://banana.dev (bias: I'm one of the founders). We run A100s for you and scale 0->1->n->0 on demand, so you only pay for what you use. I'm at erik@banana.dev if you want any help with it :)
Eg. might have only a few minutes of usage in an hour and the rest of the time is spent waiting for requests. How's that billed?
Re: Ask HN: What do you use for ML Hosting?
#20For serverless: check the list I posted here https://news.ycombinator.com/item?id=34742087 (I ended up using Banana, it was fine) For non-serverless, some to check out are these (though likely all overkill if you just need a single GPU) https://www.coreweave.com/ vast.ai Lambda labs