Pycon Sweden 2024

Mastering Generative AI with Python: A Hands-On Workshop with OpenAI and Anthropic
2024-11-14 , Tutorial 1

AI is a hot topic these days! However it's not always clear how to get the best use of it, how to test and trust it, and how to build it into your product. In this workshop, we will explore practical applications of Generative AI with Python, focusing on AI models like OpenAI’s GPT-3-5 and Anthropic’s Claude.

At Lyst, we have been using OpenAI and Anthropic for the past year in various ways. We will share insights from our own work, where AI has significantly enhanced our day-to-day operations. Using OpenAI to tag customer feedback sentiment has enabled employees to extract actionable insights from large volumes of data, improving decision-making and customer understanding. Using Anthropic's AI models to create product titles has resulted in unique, more descriptive content on Lyst's platform, which has increased customer engagement and sales.

In this interactive and engaging workshop, we want attendees to get hands on with these AI models. We'll have OpenAI and Antropic credits for attendees to use, and the workshop will cover essential best practices, prompt engineering strategies to get the model to do what you need it to do, strategies for testing and evaluating, and what to keep in mind when incorporating the model into your product. Ratuja and Sophie have learned a lot of this through trial and error and are excited to share their learnings with the group.

We have a dataset where attendees can use AI prompts to enhance the data and serve it in a Django App. This workshop will both give a high level overview of best practices when incorporating AI into your application and give technical users a chance to play around and learn for themselves.


In this workshop, we will be giving attendees a hands-on approach to using AI models in Python applications, specifically OpenAI’s GPT-3-5 and Anthropic’s Claude.

Ratuja and Sophie are senior backend engineers at Lyst, a fashion marketplace containing over 8 million products. Because of this, we need to make sure we have scalable and robust architecture.

We have experimented with using Generative AI to aid this. Ratuja built a Django application using OpenAI to tag themes of customer reviews - allowing us to understand customers better. Sophie used Anthropic models to improve descriptions of products, making them better for customers. She tested various models to find the best one for her use case before implementing in production. We learned a lot through this process and are keen to share more in this workshop!

The workshop will follow the structure:
- Overview of Generative AI; using technologies like OpenAI and Anthropic in production
- Overview of the models and choosing the right one for your needs.
- Best practices for prompt engineering.
- Testing strategies to validate your model is performing.
- Attendees get hands on! They will download a dataset and a partially built Django App . They’ll get to use OpenAI and Anthropic credits to enrich the dataset and productionize their models.
- Wrap up, the group can share learnings and discuss ideas they have for using AI in their own projects.

We hope this workshop will be useful for Python developers interested in incorporating AI into their work. We believe AI is not a fad and will continue to grow. There’s so much information online; it’s hard to know where to start. With the interactive workshop, we want attendees to leave understanding the basics and best practices in a way which will be transferable to many use cases!

Ratuja is a senior backend engineer at Tech Lead at Lyst - a shopping app which helps customers have a better experience online shopping.

She's currently working in Payments and Marketing Engineering and enjoys playing with new technologies, refactoring code to make it prettier and more satisfying, and all around just solving every day life problems with Python. She's also a member of Lyst's Tech Culture Group and Women in Engineering Committee, helping with initiatives like company wide hack-days and fostering a community of women in tech at Lyst.

Sophie is a Senior Backend Engineer at Lyst, a leading shopping platform that elevates the online shopping experience for customers globally.

As a key member of the Product Data team, she plays a crucial role in ensuring that Lyst’s customers and internal teams have access to high-quality, accurate inventory data and that Lyst delivers a seamless and valuable integration experience for its partners. She is passionate about collaboration and problem-solving and thrives when diving into new challenges alongside fellow engineers.

In addition to her technical role, Sophie is an active member of Lyst’s Women in Engineering committee. She has spearheaded initiatives such as a work experience programme in partnership with Next Tech Girls and an internal, female-focused mentorship programme aimed at fostering growth and support for women in tech.