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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
240
DevOps for Data Science
anandology
0
130
Managing Machine Learning Models in Production - Strata Singapore 2017
anandology
0
740
Real World Challenges in Deploying Machine Learning Applications
anandology
0
470
Deploying ML apps in minutes
anandology
1
540
Recreational Programming
anandology
4
570
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
Getting Started with Vibe Coding
miccheng
0
260
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
260
Kiro Crewによる開発体験ーKiro CrewでStrands Decider 2B に関する技術検証をやってみた
satoshi256kbyte
1
240
エラーチャンネルのボールを拾い続けて鍛えるエンジニアの地力 / phpcon-niigata2026
meihei3
1
660
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
240
Stage 3でも仕様は変わる。アプリケーション開発者のためのTC39プロセスの読み方
bicstone
2
1.5k
LLM 101
dalinaum
0
570
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
390
てっくりーどのおしごと in Swift愛好会 #101
yuukiw00w
2
120
はじめてのPLATEAU
nokonoko1203
1
690
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.4k
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
260
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
370
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
650
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
970
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
480
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
760
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
610
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Claude Code のすすめ
schroneko
67
230k
Discover your Explorer Soul
emna__ayadi
2
1.4k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
70k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k