Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Firefly - Deploying functions made easy
Search
Anand Chitipothu
July 10, 2017
Programming
820
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Firefly - Deploying functions made easy
Lightning talk given at EuroPython 2017
Anand Chitipothu
July 10, 2017
More Decks by Anand Chitipothu
See All by Anand Chitipothu
Machine Learning as a Service
anandology
0
230
DevOps for Data Science
anandology
0
120
Managing Machine Learning Models in Production - Strata Singapore 2017
anandology
0
730
Real World Challenges in Deploying Machine Learning Applications
anandology
0
460
Deploying ML apps in minutes
anandology
1
530
Recreational Programming
anandology
4
560
Managing Machine Learning Models in Production
anandology
1
710
Distributed Machine Learning - Challenges & Opportunities
anandology
0
320
Writing Beautiful Code - EuroPython 2017
anandology
3
1.4k
Other Decks in Programming
See All in Programming
Performance Optimization With LLMs
xleitix
0
210
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
260
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
190
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
420
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
1
200
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
120
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
840
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.5k
オーケストレーション記述言語 Katari
yukikurage
0
200
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
320
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
800
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.4k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Building an army of robots
kneath
307
47k
The Curse of the Amulet
leimatthew05
3
16k
Leo the Paperboy
mayatellez
10
2.4k
ラッコキーワード サービス紹介資料
rakko
4
5.5M
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
740
Six Lessons from altMBA
skipperchong
29
4.5k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Transcript
Firefly Deploying functions made easy!
Who is speaking? Anand Chitipothu @anandology • building a data
science platform at @rorodata • advanced programming courses at @pipalacademy
The problem How to expose a function as an API
for others to use?
Why? • To use it in a different environment •
Loose coupling
Use cases • Deploy a machine learning model • preprocess
an image • live price check
Challenges • Requires writing a web application • What about
authentication? • How to do data validation? • How I need write a client library too?
Welcome to Firefly Deploying functions made easy!
Code Write your function: # sq.py def square(n): return n*n
Run Start web service: $ firefly sq.square [INFO] Starting gunicorn
19.7.1 [INFO] Listening at: http://127.0.0.1:8000 ...
Use And use it with a client. >>> from firefly.client
import Client >>> client = Client("http://127.0.0.1:8000") >>> client.square(n=4) 16
Behind the scenes, it is a RESTful API. $ curl
-d '{"n": 4}' http://127.0.0.1:8000/square 16 And supports any JSON-friendly datatype.
More practical example Deploying a machine learning model. # model.py
import pickle model = pickle.load('model.pkl') def predict(features): result = model.predict(features]) return int(result[0])
Run the server using: $ firefly model.predict ... And use
it in the client: >>> remote_model = Client("http://localhost:8080/") >>> remote_model.predict(features=[5.9, 3, 5.1, 1.8])) 2
Authentication Firefly has built-in support for autentication. $ firefly --token
abcd1234 sq.square ... The client must pass the same token to autenticate it. >>> client = Client("http://127.0.0.1:8000", auth_token="abcd1234") >>> client.square(n=4) 16
Upcoming Features... • supporting other input and output content-types in
addition to json. (for example, a function to resize an image) • validation using type annotations • caching support
It's open source! https://github.com/rorodata/firefly To install: pip install firefly-python
Questions? • https://firefly-python.readthedocs.io/ • https://github.com/rorodata/firefly