DEV Community

Cover image for Recycling made easy: a Polish recycling assistant powered by Gemma 4
Klaudia Grzondziel
Klaudia Grzondziel

Posted on • Edited on

Recycling made easy: a Polish recycling assistant powered by Gemma 4

Gemma 4 Challenge: Build With Gemma 4 Submission

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

I clearly remember this scene: my mom and I are dyeing our hair together. I'm holding a small plastic bottle that still has some dye inside, and I'm asking myself: where the hell do I throw this? I ask my mom – she has no idea either. Plastic bin, even though the bottle is contaminated with dye? Or is it mixed waste now?

Sorting waste in Poland has improved a lot over the last few years. The system is based on six colourful bins that you'll see in any backyard:

Bin Color What goes in
PLASTIC/METAL 🟡 (yellow) plastic bottles, cans
PAPER 🔵 (blue) paper, cardboard
GLASS 🟢 (green) glass jars, bottles
BIO 🟤 (brown) food scraps, garden waste
MIXED ⚫ (black/grey) mixed waste: contaminated or composite items
TEXTILE 🟣 (violet) clothes, shoes (separate collection mandatory since Jan 2026)

Photo of Polish color-coded recycling bins

Obvious stuff like cardboard or an old pair of socks is easy. But there are traps – you can't throw an old mug or a broken mirror into the glass bin, even though it seems to be the right choice. And then there's the hair dye bottle with dye still inside. The pizza box with grease on the bottom. The blister pack from your pills.

Real debates are happening on the Polish internet about this stuff. Type "gdzie wyrzucić..." into Google and you'll see how much people struggle. I once watched two friends argue about where a used coffee cup goes — one swore it was paper, the other said mixed waste because of the plastic lining.

Confusing? Hell yeah, it is! 😩

What I Built

That's why I built a web app called Gdzie to wyrzucić? [ENG: Where to throw it?]. It's a Polish recycling assistant – you take a photo of an item with your camera and send it to a Gemma 4-backed AI assistant. As a response, it tells you which bin the waste goes in.

The photos are not stored anywhere – they are processed in-memory by the API route, sent to Gemma 4 for analysis, and discarded immediately after the response is returned.

The recycling rules live in a ~200-line system prompt. What you see now is v4 – there were a lot of iterations and a lot of live testing along the way. At this point, my entire phone gallery has turned into one big collection of trash photos 🙈 And my neighbours probably think I've gone nuts, because I keep photographing "interesting" items from the backyard bin to see how Gemma will handle them 😅

The app is Polish-only by design – Polish recycling rules apply to people in Poland, and the system prompt is built around Polish categories. I'm planning to add English and Ukrainian translations, though, because there are minorities living in Poland who could really use this, too. Until then, I hope the app is intuitive enough for a non-Polish speaker.

Demo

To test the project, go to Gdzie to wyrzucić?. The walkthrough is as follows:

  1. Take a photo of the wasted item or choose one from your gallery. Press the Aparat or Galeria button, respectively.
  2. Click Analizuj and wait ~15-30 seconds to get the sorting result. Alternatively, click Zrób ponownie if you are not satisfied with the photo and want to retake it.
  3. The app returns the answer to which bin you should throw your waste, together with the explanation and some additional remarks (if any).
  4. If you want to try another waste item, press Sprawdź inny przedmiot.

For the English-speaking dev.to users, I prepared a walkthrough video with some explanation:

Code

All the code lives in the recycling-app repository on GitHub.

At this point, let me be honest with you – I vibe-coded this. I am a Technical Writer, not a Developer, and even though I have experience with git and done some small code updates in the past, this is the first bigger project I've built myself.

It was a multi-agent work. I used Claude Code for the boilerplate code and for turning business logic into reality. I used Gemini's deep search to dig up current recycling rules from Polish government sources and eco-experts. I was the brain behind everything else – the idea, the business logic, the testing, the improvements, leading each next step, holding it all together. And Gemma is the heart of the project 💛 You can read about my experiences as a beginner in another post:

How I Used Gemma 4

The app sends the photo to Gemma 4 with a detailed system prompt that encodes the current Polish recycling rules. Gemma looks at the image and returns a structured JSON: which bin, how to prepare the item, an explanation, and an extra note if relevant. The frontend turns that into a result card in the right bin colour.

I went with Gemma 4 26B Mixture-of-Experts (gemma-4-26b-a4b-it) via Google AI Studio's free tier. The MoE architecture only activates around 4B parameters per token out of ~26B total. It's efficient enough to run on the free tier and smart enough to handle the actually hard cases.

Gemma 4 26B A4B model listing on Google AI Studio

The free tier means the demo runs 24/7 without costs. And because Gemma is open-weights, the same app could one day ship with Gemma 4 E2B or E4B running directly on the user's device. That's a path I'd like to explore.

Known limitations

The test phase revealed that some photos trigger an immediate error before Gemma is even reached. The failing photos share the same characteristics: detailed scenes, multiple objects, busy compositions, and possibly larger file sizes than simple isolated-item photos. I think that the issue is about image size or encoding, but I need to confirm it yet.

Also, analysis takes 10–15 seconds. Free-tier cloud inference is slow. It is acceptable for the initial phase and the challenge, but I'd need to think about some other options in the future.

What's Next

The roadmap is in the issue tracker. A few highlights:

  • Multilingual support for English and Ukrainian – many Ukrainians have moved to Poland in recent years, and there are also exchange students and expats living in Poland who would find an English translation handy.
  • Interactive clarification – when Gemma isn't sure what's in the photo, let it ask the user a yes/no question instead of guessing.
  • Suggesting reuse before recycling for books, clean clothes, working electronics, old furniture, and so on. Recycling is good. Reusing is better.

Closing sentence

If you're in Poland, try out Gdzie to wyrzucić?. If you spot a misclassification or a rule the app gets wrong, please open an issue – I'd love to keep improving it.

Thanks to the dev.to challenge for the deadline, to my colleagues and friends who tested the app, and to Gemma 4 for actually making it all happen 💛

Top comments (59)

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

This is very cool! It would be neat to have it as an Arduino automating this. Obviously, the downside would be speed since Gemma 4 is slow, but I guess that speed is always an issue.

Would you be interested in joining the DEVengers org? We would love to have you and I believe you have done great work so far here on DEV? If not, that's ok!

Great job and well done Klaudia :D

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Thank you so much, Francis! Your comment means a lot. Could you tell me a bit more about the DEVengers org? Sounds intriguing!

I am planning to develop this app even after the challenge ends, so I am happy to hear any feedback and ideas for improvements 💛

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ • Edited

Thanks! For the org, I am assembling the greatest minds on DEV and I believe you have proven that based on your work so far!

When it comes to posting, there isn't a fix schedule and you can post anytime you want. If you are planning on posting, you will need to email me before hand so I can review before publishing. The criteria is the post is high quality and that is helpful for everyone on dev regardless of skill level.

Let me know if anything else :D

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

Wow, sounds awesome! Of course I'd be happy to join 💛

Thread Thread
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Sounds awesome! It is sent to your email! Do let me know if you have any questions.

If you are planning on posting, feel free to email me (located in my portfolio that I listed on my profile).

Thanks! Hope you win this event :D

Collapse
 
learn2027 profile image
meow.hair

Dear Klaudia,

I recently read your inspiring article about building "Gdzie to wyrzucić?" and wanted to sincerely thank you for sharing your journey.

Despite describing yourself as a non-developer, you’ve built a practical web app that solves a real, everyday problem in Poland. Turning your own confusion about a hair dye bottle into a tool that helps the entire community is a beautiful example of how technology should truly serve people.

Your future plans—adding multilingual support, improving AI accuracy, and encouraging reuse—are highly commendable. Wishing you continued success, and I hope this project is just the beginning of many more impactful creations.

Thank you for being an inspiration.

Warm regards,

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Aaaaw, thank you for your comment; it's very touching 🥹💛

Collapse
 
xwero profile image
david duymelinck

The first question I have is why use an LLM?

In Belgium we have those recycling woes too. We don't have that many different containers. But plastics for us is the one that has many rules.

Because the rules are defined my first idea would be a question flow with the first question, what is it you want to throw away. If it is not clear or the package warrants further questions they will be asked.

The main problem with photos is you can manipulate them, even unintentional, to miscategorise the item.
And the argument of the coffee cup can be solved too, because I don't think those friends had the coffee mug at hand.

For the LLM did you do tests to see if Gemma followed the rules? LLM's are known to lie confidently.

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Thank you for the questions! A decision-tree flow would work for many cases, but sometimes users have no idea where an item should go (for example, mugs shouldn't go to the glass bin even though they're made of glass; a shop receipt shouldn't go to paper even though it looks like paper; a pizza box would go to paper, but what about when it's full of grease?). People are confused. The app is meant to solve that confusion.

My friends and I went through many tests and iteratively improved the prompt (the current one is v4). I also integrated the results of the deep-search I ran with Gemini into the prompt. Since then, the test results have been correct. Of course, misclassification can still happen, and I'd love to hear feedback and keep improving the app. But if it can solve the everyday issue like the one I had with the hair dye bottle, I consider it doing its job.

Collapse
 
xwero profile image
david duymelinck

A decision-tree flow would work for many cases, but sometimes users have no idea where an item should go

The start shouldn't be the bin, but the thing that gets thrown away. That is also the base of your app.

I see no reason why you want to feed an LLM a photo and rules, while it can be done with words and a decision-tree.

Adding an LLM makes the app harder to maintain, slow and expensive. Now you are on the free tier, but once you start paying for tokens that is your budget that is getting spend for no benefit of your own.

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

The app was designed specifically for the hard cases – everyone knows where a banana peel or a plain plastic bottle goes. The cases that actually need help are blister packs, paper coffee cups, composite wrappers... and a decision tree would need 5-10 clarifying questions to handle these. One photo skips all of that.

Regarding maintenance, Polish rules change often (only this year we got the deposit system and new textile bins), so updating a Markdown file with the prompt is way easier than rewriting rule-tree code every time.

Fair point with the token costs, though. The free tier handles a lot for now, and it helped me prove to myself that the app makes sense in general. My next task is to find alternatives if scaling becomes an issue, and to check how to minimize the ~15-30 second wait time.

Thread Thread
 
xwero profile image
david duymelinck

a decision tree would need 5-10 clarifying questions to handle these.

That feels like an exaggeration. When there are containers the questions are:

  • Is the content poisonous or can it cause other problems
  • Can rinsing make the container recyclable

The rules should already have taken in account those questions. It is where the rules depend on the people to take extra steps to make the item recyclable that the follow up questions are going to pop up.

so updating a Markdown file with the prompt is way easier than rewriting rule-tree code every time

Why would you rewrite the tree every time? Sure the bigger the change in rules, the bigger the change in code. But that is equivalent to the change in Markdown.

15-30 second wait time.

That seems a long time for an answer. When an app has an icon UI users don't need to type and they get an almost instant answer.

The main thing I want to communicate is that while everything can be an LLM powered app, the biggest question is should it be an LLM powered app.

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

The main thing I want to communicate is that while everything can be an LLM powered app, the biggest question is should it be an LLM powered app.

I get you! Believe it or not, but I am not the biggest AI enthusiast. Actually, I am very often sceptical and saw many misuses. However, the design for this app assumed that the user takes a photo and gets an answer. Could I have implemented it better? Probably 😅 My job now is to improve it and make it more efficient.

Collapse
 
harjjotsinghh profile image
Harjot Singh

Nice focused build - and a great case for why a smaller model (Gemma) is the right call here, not a limitation. A recycling assistant is a narrow, well-bounded domain: the answer space is "which bin / is this recyclable locally," which a small model handles fine, runs cheaply, and can even run on-device for privacy/offline. Reaching for a giant frontier model here would be overkill burning cost for no quality gain. Right-sized model for a scoped task is exactly the discipline more people should apply.

The localization angle is the genuinely hard part you nailed - recycling rules are hyper-local (what's recyclable in one Polish municipality differs from the next), so the value isn't the model's general knowledge, it's grounding it in the correct local rules. That ground-in-authoritative-local-data step is what makes it actually right rather than plausibly-right. Same principle I lean on in Moonshift (a multi-agent pipeline that ships a prompt to a deployed SaaS) - scoped model + grounded data beats big-model-guessing, and keeps cost down (~$3 a build). Lovely practical project with real civic value. Is the local-rules grounding from a structured dataset, or did you have to assemble the municipality rules yourself? That data-gathering is usually the unglamorous bulk of the work.

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Thank you for the comment! 💛

That data-gathering is usually the unglamorous bulk of the work.

Yes, this was one of the hardest parts, but AI helped as well. I ran Gemini's deep search on government sites, local rules, and Polish recycling experts, which gave me a detailed report on Poland's recycling rules. Then I fed it to Gemma, and after that the test results improved drastically. All the real-world tests that failed previously passed after the deep-search and skill update.

Collapse
 
rachef_khoulod_a166c693fa_13 profile image
AlToolKit

This is such a cool use of technology for real-world impact! Gyma is a great example of how a simple app idea can actually change people's daily habits around waste sorting.
What I find most impressive is that waste management is usually seen as a "boring" problem, but turning it into an intuitive app experience makes it accessible to everyone — not just eco-enthusiasts.
Would love to see something like this expand beyond Poland. The world needs more apps that make doing the right thing easier than doing nothing. 🌍♻️

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Thank you for your kind words 💛 This was exactly the issue – many people don't have the time, energy, or wish to follow recycling rules, and the rules change all the time (just this year, Poland introduced new rules for sorting textiles and a deposit system for plastic bottles).

The app is meant to help people with everyday issues and take away some of the mental load.

Would love to see something like this expand beyond Poland.

This is my wish, too! 🥹 For now, I do what I can to improve things locally. That's why I want to develop this app to make it more accessible to people and promote it, even after the challenge ends.

Collapse
 
rachef_khoulod_a166c693fa_13 profile image
AlToolKit

Yes, I wish you the best of luck. As I understand it, you have experience in development and coding. Actually, I want to learn, but I haven't found anyone to guide me or where to start. I hope you'll read my articles to support me and offer advice.

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

Actually, I am a Technical Writer, not a Developer, and this is the first app that I vibe-coded 😅 I'll be happy to read your articles, though!

Thread Thread
 
rachef_khoulod_a166c693fa_13 profile image
AlToolKit

Oh, okay, that's fine. So please read the articles on my page and invite your friends to read them too, and give me your feedback and advice. Actually, I'm a complete beginner. May I know where or what you do as a technical writer?

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

In short, as a Technical Writer, I make sure that the project is well-described. This includes creating a proper documentation strategy, documentation structure and guidelines, reviewing documentation PRs, looking for gaps in docs, addressing them, writing and testing instructions, working closely with engineers to understand the product, and being the user's advocate when something is unclear or hard to use.

Thread Thread
 
rachef_khoulod_a166c693fa_13 profile image
AlToolKit

Wow, that's really great! But do you work alone or for a company?

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

Right now, I work for the company. However, I've also seen some contract roles for Technical Writers.

Thread Thread
 
rachef_khoulod_a166c693fa_13 profile image
AlToolKit

That's great! I wish you the best of luck. I just wanted to ask, for example, do these companies hire employees who work online?

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

Thank you. Yes, however, recently I have seen a big trend of moving back to the office or a hybrid working model.

Thread Thread
 
rachef_khoulod_a166c693fa_13 profile image
AlToolKit

Okay, what is your company's field of work, please?

Collapse
 
itsugo profile image
Aryan Choudhary

I'm just blown away by this project - a Polish recycling assistant web app that can identify what bin to put things in just by taking a photo? It's almost like having a tiny little recycling assistant by your side, guiding you through all the confusing packaging and hard-to-sort items. I'm curious to see how it handles the tricky cases, like blister packs and composite wrappers - Klaudia, you must have had to get creative to make it work! Amazing work!!!

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

It's almost like having a tiny little recycling assistant by your side, guiding you through all the confusing packaging and hard-to-sort items.

Thank you so much! This was exactly the goal 😊

Collapse
 
varsha_ojha_5b45cb023937b profile image
Varsha Ojha

This is a really practical use case for AI. I like that it solves a small everyday confusion instead of trying to be another generic assistant. Recycling rules can be surprisingly unclear, especially when items are contaminated or made of mixed materials. The photo based flow also makes sense here because most people don’t want to read long rules. They just want to know where the item goes.

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

The photo based flow also makes sense here because most people don’t want to read long rules. They just want to know where the item goes.

Exactly! Of course, some people are deeply engaged, read expert blogs, and are always up-to-date. But most people just follow the most obvious choice, which is not always the correct one. The app's goal is to help with that 🙂

Collapse
 
varsha_ojha_5b45cb023937b profile image
Varsha Ojha

Exactly. Most people only look up recycling rules when they’re already unsure. So making the right choice easier in that moment is the real value. Simple, practical, and much more useful than another generic AI assistant.

Collapse
 
embernoglow profile image
EmberNoGlow

good job!

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Thank you 💛

Collapse
 
lloydjackmanukpl profile image
Lloyd-Jackman-UKPL

So, I am an Englishman living in the Polish countryside where there is the joke I am sure you are aware of, in that in the Polish countryside they have been sorting their waste for years:

  • what you can burn during the day
  • what you have to burn at night :-D

Obviously, I am joking and am keen on recycling, taking good advantage of this, but my local council (Gmina Kościerzyna) provides this app called Eco Harmonogram which provides details of when what is being collected and how to dispose of different items. It even has an English interface, though the items to be thrown away in have to be searched for with their Polish names.

The feature you've developed is interesting though, but feels like it either needs to integrate with local collection schedules to complete it as a more rounded and useful app, or you should be taking this feature to developers like the app I mentioned and offering to create this feature in their app.

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Ahaha, I totally get you! 😄 I have family in the countryside, and I've seen many people still sorting their waste the way you described 😄

Right now, I am basing my prompt on the general Polish national guidelines. Including local nuances crossed my mind, but I decided it would be overkill for the project in this phase of development. I have it on the roadmap, though 🙂

Collapse
 
lloydjackmanukpl profile image
Lloyd-Jackman-UKPL • Edited

So you're not going to introduce a "night mode" feature that both darkens the screen and also recommends burning everything 😉

Thread Thread
 
klaudiagrz profile image
Klaudia Grzondziel

Collapse
 
denerfernandes profile image
Dener Fernandes

Cześć,very nice app, i love this thinks, mybe you can try to take some sponsors from government or private companies. I live in Poland and i have problem to find place to discart motorcycle oleo its good think to put this capability XD

Collapse
 
klaudiagrz profile image
Klaudia Grzondziel

Cześć! Thank you for the feedback! 💚 I was thinking of adding some tips saying that some items could be reused on sites like Allegro, Vinted, or even local charity points. I think it's a feature worth adding:) Regarding sponsors... maybe. I feel this could be the proper direction; however, I'd need to provide some improvements to the app first.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.