Happy new year folks!
As 2022 drew to a close, I was spending a lot of my free time helping out the Stable Diffusion community with ideas for how to publish APIs around their Stable Diffusion Model. While thinking about how researchers prototype their work, I realised that GraphQL was the perfect tool for quickly prototyping and sharing model.
i thought .. wouldn’t it be great if there was a way to take advantage of the dynamic nature of GraphQL to allow pythonistas the ability to spin up a super fast Rust powered GraphQL API, just by describing the schema in Python.
It seemed like the perfect tool for machine learning models where requests are always sequential, as (most) models will never operate in a parallel fashion. You can almost always decorate a single entry point for inference with a machine learning model. The idea for FastQL was born!
FastQL is new Python package that makes it easy to prototype and share Machine Learning models using GraphQL! FastQL uses rust to serve an API on a separate process, making it incredibly fast and efficient.
FastQL is super easy to use - just give it a callback function and a Python dictionary describing your GraphQL API, and it will handle the rest. This makes it easy to prototype ML models and get them up and running in no time.
You can find it on pypi @ fastqlapi and on GitHub at https://github.com/happy-machine/FastQL. I’ve included simple steps and Dockerfile to allow you to spin up your own huggingface diffusers model (ie. Stable diffusion2, midjourney).
There’s also an example allowing you to train a model on your own images, with simple instructions to help you spin up on AWS in minutes, even if you’re new to ML and Python. This is just the beginning, we’d love your help, tap me up if you’d like to get involved!