API document for mleap-serving 1.13.0
It seems from release 1.13.0, the mleap-serving API was changed without official document. I found a document here but not success when testing
Here is my steps:
git clone https://github.com/combust/mleap.git
cd mleap && git checkout --detach 6a722e455df7cbcc6da07cf77d6522e38ec1556a
git submodule init
git submodule update
sbt compile
sbt mleap-serving/universal:packageZipTarball
tar -zxvf mleap-serving/target/universal/mleap-serving-0.13.0.tgz
mkdir /tmp/ml
mv mleap-serving-0.13.0/ /tmp/ml/
/tmp/ml/mleap-serving-0.13.0/bin/mleap-serving
# load model (ok)
curl -X POST \
http://localhost:8080/models \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 97c74630-8b22-d9d9-019d-0f9dd13b8d03' \
-d '{
"modelName": "airbnb",
"uri": "<dir>/airbnb.model.lr.zip",
"config": {
"memoryTimeout": 1000,
"diskTimeout": 1000
},
"force": false
}'
# find model (not found)
curl -X GET \
http://localhost:8080/models/airbnb \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: a1ea0066-16a3-4040-cb52-6d138017957b'
# other API like transform or get-meta also don't work
Anything else that I can test?

@Khiem-Tran I am working on updating the docs here http://mleap-docs.combust.ml/mleap-serving/ but in the meantime, could you please to update the uri on the load model request from /Users/... to file:/Users/.... and see if that solves your issue?
Yes, it works after I added the prefix file: on uri and increase timeout configs from 1000 to 900000 as here. Thank you very much
Btw, there is a small issue that the provided json input does not work with airbnb.model.lr.zip because onehotEncoder not recognise value in some features but working well on random forest model
glad it worked! @Khiem-Tran is it alright to close this issue now?
@ancasarb @Khiem-Tran
i have registered the Model like Below:
body='{"modelName":"airbnb","uri":"file:/models/airbnb.model.lr.zip","config":{"memoryTimeout":900000,"diskTimeout":900000},"force":false}'
curl --header "Content-Type: application/json"
--request POST
--data "$body" http://localhost:8080/models
When i try hit for Transform like Below ways :
body='{"modelName":"airbnb","format":"ml.combust.mleap.json","initTimeout":"35000","tag":0,"frame":"frame.airbnb.json"}'
curl --header "Content-Type: application/json"
--request POST
--data "$body" http://localhost:8080/models/transform
body='/models/frame.airbnb.json'
curl --header "Content-Type: application/json"
--header "timeout: 1000"
--request POST
--data "$body" http://localhost:8080/models/airbnb/transform
i cannot see that data is processing....I Just want to know do we need to give the Filename or json string input ..?
Please Clarify me about this.. Thanks in Advance !! resources:
and for json encoded mleap : https://s3-us-west-2.amazonaws.com/mleap-demo/frame.airbnb.json
@itsmesrds can you try with the random-forest model from the same tutorial? Last time, I could not use the lr.zip for transforming the json sample. I think the build has some change on features that make the json file is not supported.
Thank you for the Quick Response... Ok ill try as you suggested ....
@Khiem-Tran please let me know..Do i have to pass the file name or path with file name or file content by converting to json string
i tried with same json ..But still its failing... Thanks
@itsmesrds, I followed this tutorial http://mleap-docs.combust.ml/mleap-serving/#load-model and succeeded to transform the sample json with rf.zip. Maybe you can try -d @/models/frame.airbnb.json
@itsmesrds you can take a look at this readme file https://github.com/combust/mleap/tree/master/mleap-spring-boot, this is how the transform endpoint works.
endpoint POST /models/{YOUR_MODEL_NAME}/transform: Transform or scoring request, replacing the chosen model name {YOUR_MODEL_NAME}, format {YOUR_FORMAT} and the appropriately encoded leap frame {ENCODED_LEAP_FRAME}
body='{"modelName":"{YOUR_MODEL_NAME}","format":"{YOUR_FORMAT}","initTimeout":"35000","tag":0,"frame":"{ENCODED_LEAP_FRAME}"}'
curl --header "Content-Type: application/json" \
--request POST \
--data "$body" http://localhost:8080/models/transform
Format can be either ml.combust.mleap.binary or ml.combust.mleap.json and your leap frame needs to be encoded with that format.
I'm having the same problems. No matter what I do, I can't get this airbnb example to run properly. It's extremely frustrating. Can you post what a valid value of $body or $ENCODED_LEAP_FRAME looks like ?
@ancasarb
@femibyte I replied to your question on the other issue raised #578