David Galera

Senior AI Engineer

I am a engineer with deep knowledge in software design and architecture, system design on AWS and event driven architectures, with expertise in building scalable applications integrating ML and genAI. I design and develop intelligent systems and architect and deploy them on AWS, leveraging services such as EC2, ECS, EKS, S3, Lambda, DynamoDB, SQS and Bedrock. Exposing services through API Gateway using both REST and WebSocket protocols, ensuring seamless real-time and asynchronous communication. I bring together cutting-edge AI capabilities and robust cloud architecture to deliver impactful, future-ready solutions that meet complex business needs. I also hold a master's degree in Data Science and have completed +130 courses at Datacamp.

Datacamp portfolio → LinkedIn
Myself in Zurich, standing in front of the river.

Portfolio projects

01

Rust nanoservices todo app

Full stack to-do application compiled into a single Rust binary, featuring to-do and auth nanoservices. The communication between nanoservices is implemented in a kernel crate whose flexible design makes possible 2 deployment strategies without changing the source code, depending on the kernel feature compiled into the target workspace. The complete app is served from the ingress workspace, which acts as a modular monolith where the views from both servers are mounted, the frontend assets are embedded into the ingress as well.

The project also features a Redis cache which loads a Rust dynamic library to execute client session validation logic inside Redis and manage JWT expiration. The kernel interfaces with the cache-client crate for Redis interaction, exposing traits to set the redis key when the user login and update it in every route access.

Learn more
Collage of logos from Rust, TypeScript, Docker, Redis, Actix, Tokio and React.
Rust Async runtime architecture diagram.

02

Custom Rust Async Runtime

I built a custom runtime to dive deeper into one of the most complex areas in Rust: Asynchronous programming. Breaking down concepts such as stackless coroutines, Futures, self-references, the Pin type and the Unpin trait.

  • - Executor: Lives in its own thread and loops popping Futures from a ready queue, constructing a Waker and calling poll on the Top Future and passing the Waker instance, the poll travels down to the Leaf Future carrying the Waker. When the ready queue is empty the thread is parked, yielding control to the OS.
  • - Leaf Future: Communicates with the Reactor. On the first poll, opens a non-blocking socket and sends the request, then registers interest for the socket in the Reactor and stores the Waker in it.
  • - Reactor: Registers/deregisters descriptors interests into mio::Poll::registry (epoll on Linux) and owns the Wakers.
  • - Event loop: Lives in a separate thread and holds Arcs of the mio::Poll::poll instance and the Wakers. Loops and blocks on epoll_wait. When an OS notification arrives, it pulls the future Waker from the Reactor and calls Waker::wake
  • - Waker::wake: Pushes the future into the ready_queue, signaling that it's ready to be polled again to advance to the next state. Unparks the Executor thread.
Learn more

03

GenAI services with FastAPI

A comprehensive Multi-modal Generative AI Platform built with FastAPI, PostgreSQL, and Qdrant as the embeddings persistence layer. Implementing a modular Domain-Driven Architecture with the Repository Pattern, the system uses open source AI models from HuggingFace for serving diverse AI tasks including text generation via TinyLlama, image synthesis with Stable Diffusion, and audio/video generation. Leveraging Retrieval-Augmented Generation (RAG), it integrates asynchronous PDF processing and Jina AI embeddings for semantic search, while managing scalable model serving through BentoML and providing real-time usage monitoring, JWT-based authentication and Alembic for robust database schema migrations.

Learn more
Collage of logos from FastAPI, PostgreSQL, Qdrant, HuggingFace and Streamlit.
Collage of logos from NestJS, MongoDB, Apollo, and React.

04

Real Time Chat web application

Fullstack Real time Chat application built with React + Material UI, Apollo GraphQL server running on NestJS and MongoDB as persistence layer. Implementing GraphQL websocket subscription for real-time communication, managing Apollo client to cache GraphQL queries on the React app, leveraging MongoDB aggregation pipelines to build GraphQL aggregated entities using a single MongoDB collection as well as chats list and messages pagination, JWT based authentication and more.

Learn more

05

Rust web application with Warp and Tokio

High-performance Question & Answer (Q&A) web API built with Rust, taking advantage of the language's type system correctness, efficiency and memory safety. Featuring the lightning-fast Warp web framework, the Tokio async runtime, and PostgreSQL persistence. The app includes robust authentication using PASETO tokens, automatic profanity filtering via the Bad Words API, and comprehensive error handling. The project compiles to a statically linked binary (musl target) that results in a Docker scratch image of 25 MB (compressed) with minimal memory consumption of ~10 MB at runtime. The API supports full CRUD operations on questions and answers with token-based authentication, paginated queries, and tracing/logging for production visibility.

Learn more
Collage with logos of Rust, Tokio, Docker and PostgreSQL
3D network

06

NeuralNet for manufacturing control data

Kaggle competition project. Given a balanced dataset, consisting of 900.000 instances with 33 features from manufacturing control data, I built a neural network using keras to predict the binary output. I applied feature engineering and feature interaction to spot patterns and transform the data to achieve 97.4% accuracy in the competition.

Learn more

07

Computer vision applied to CIFAR-10

Image classification of the CIFAR-10 dataset using deep learning and the fastai library. I used transfer learning with resnet34 and resnet50 pretrained CNNs, applying data augmentation techniques such as mixup.

Learn more
Microchip with AI logo
Black and white image of racks with DVD films

08

Movie recommender engine

Recommender system on the movielens dataset implemented in Python. I implemented 4 recommendation approaches:

  • - Non personalized
  • - Content based, a Naive Bayes spam filter is also implemented.
  • - Colaborative filtering, item-item and user-user.
  • - Colaborative filtering using the Python surprise library.
Learn more

09

Density estimation

This project consists of 2 parts. In the first one, I estimate the probability density function of univariate data using kernel methods (non-parametric) . I fit the kernel bandwidth using 2 approaches: MISE and K-Fold cross-validation.
In the second part, I fit a Gaussian Mixture to multivariate data from diabetes patients, tunning the covariance type and number of components with K-Fold CV.

Learn more
Space with stars forming clusters
Pile of cans with binary numbers.

10

MaxSAT optimal correlation clustering

CORRCLUSTERING ∈ NP
In this project, I created an instance of the CORRCLUSTERING problem and performed a polynomial-time reduction to SAT. I obtained a propositional formula by reducing the problem to the HARD and SOFT clauses described in the paper published in 2013 by Jeremias Berg and Matti Järvisalo titled Optimal Correlation Clustering via MaxSAT. Finally, I applied a MaxSAT Solver to obtain a Maximum SATisfiability resulting clustering.

Learn more

Certifications

Master thesis

IEC award & AIME conference paper

I received the Catalan society of technology award, presented by Institut d'Estudis Catalans (IEC) for my master's thesis, titled Frequent patterns of childhood overweight from longitudinal data on parental and early-life of infants health.
A data science project that I carried out in collaboration with the Institut d'investigació biòmedica de Girona and from which we published the following conference paper at AIME '24 conference.

Frequent patterns of childhood overweight from longitudinal data on parental and early-life of infants health

Published in 22nd International Conference on AI in Medicine (AIME 24), Salt Lake City, Utah, US, July 7-12th, 2024.

In this work, frequent pattern mining is used to find the risk factors of childhood obesity, taking into account the relationship among the data gathered in different visits. The experiments carried out on the data collected from 386 children from Girona and Figueres (Spain) demonstrate the relevance of discriminant frequent patterns for childhood overweight prediction.

Recommended citation: López, B., Galera, D., López-Bermejo, A., Bassols, J. (2024). Frequent Patterns of Childhood Overweight from Longitudinal Data on Parental and Early-Life of Infants Health. In: Finkelstein, J., Moskovitch, R., Parimbelli, E. (eds) Artificial Intelligence in Medicine. AIME 2024. Lecture Notes in Computer Science(), vol 14844. Springer, Cham.
https://doi.org/10.1007/978-3-031-66538-7_7