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
830
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
Transcript
17 slides
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
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
740
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
720
Distributed Machine Learning - Challenges & Opportunities
anandology
0
330
Writing Beautiful Code - EuroPython 2017
anandology
3
1.4k
Other Decks in Programming
See All in Programming
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
580
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
370
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
720
AI Augmentation Techniques with Liberty
ivargrimstad
1
520
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
430
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
330
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
260
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.1k
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
280
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
320
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
250
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Documentation Writing (for coders)
carmenintech
77
5.6k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Ethics towards AI in product and experience design
skipperchong
2
470
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
330
The Curse of the Amulet
leimatthew05
4
17k
Six Lessons from altMBA
skipperchong
29
4.6k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
640
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k