Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining api routes #41

Closed
hieuthehungry opened this issue May 13, 2021 · 3 comments
Closed

Defining api routes #41

hieuthehungry opened this issue May 13, 2021 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested triaged We are working on the problem

Comments

@hieuthehungry
Copy link

I've recently picked up on using this framework. I can't find instruction on how to define the specific URL for the API, other than IP:port. What I want to do is deploying an API to an URL like IP:port/route/to/api. How do I achieve that? Thank you.

@lamhoangtung lamhoangtung self-assigned this May 13, 2021
@lamhoangtung lamhoangtung added documentation Improvements or additions to documentation question Further information is requested triaged We are working on the problem labels May 13, 2021
@lamhoangtung lamhoangtung added this to To do in mlchain-core-python via automation May 13, 2021
@lamhoangtung
Copy link
Contributor

Hi @hieuthehungry. Thanks for the interest!

First of all, sorry for the lack of up to date documentation, since we are still iterating the library, we haven't really touch the documentation part.

For now, mlchain does not suport custom API route. There will be only the default route like host:port/call/method

For example, if your served model is something like this:

class Model:
    def predict(self, image):
        ....
        return res

    def predict_batch(self, images):
       ....
       return res

Running on 0.0.0.0 at port 9999. Then the server would only have 2 default route:

0.0.0.0:9999/call/predict
0.0.0.0:9999/call/predict_batch

I hope this can help ;)

@lamhoangtung lamhoangtung moved this from To do to In progress in mlchain-core-python May 13, 2021
@lamhoangtung
Copy link
Contributor

Are the answer satisfied you @hieuthehungry. If it's not, feel free to let us know ;)

@hieuthehungry
Copy link
Author

I got it, thanks for the answer.

mlchain-core-python automation moved this from In progress to Done May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested triaged We are working on the problem
Projects
Development

No branches or pull requests

2 participants