{"id":18654903,"url":"https://github.com/mynameisvinn/kerasrest","last_synced_at":"2026-05-04T08:40:24.445Z","repository":{"id":98221031,"uuid":"101894712","full_name":"mynameisvinn/KerasREST","owner":"mynameisvinn","description":"serving keras models","archived":false,"fork":false,"pushed_at":"2018-03-18T13:44:38.000Z","size":6920,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-12T17:26:03.139Z","etag":null,"topics":["docker","keras","machine-learning","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mynameisvinn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-30T14:55:50.000Z","updated_at":"2018-03-18T13:44:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff86c9fd-5221-4901-90b5-d4ab7ee753e7","html_url":"https://github.com/mynameisvinn/KerasREST","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mynameisvinn/KerasREST","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2FKerasREST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2FKerasREST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2FKerasREST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2FKerasREST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mynameisvinn","download_url":"https://codeload.github.com/mynameisvinn/KerasREST/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2FKerasREST/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32600967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","keras","machine-learning","rest-api"],"created_at":"2024-11-07T07:16:59.507Z","updated_at":"2026-05-04T08:40:24.411Z","avatar_url":"https://github.com/mynameisvinn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keras server\ndeploying keras model through rest.\n\n## training the model\nrun `python train.py` to train a XOR model. we'll keep it simple and use a binary classifier with a 1 single hidden layer.\n\n## deploying\n### option 1: local\nassuming a trained model exists, run:\n```bash\npython server.py\npython client.py  # separate terminal\n```\n\n### option 2: docker\nfirst, build docker image with `docker build -t mynameisvinn/kerasrest .` (dont forget the period).\n\nthen, run docker with `docker run -d -p 5000:5000 mynameisvinn/kerasrest`. the argument `-p 5000:5000` binds the container's port to local port.\n\nfinally, from another terminal, run `python client.py`. remember, docker containers are *virtual machines* and therefore have unique ip addresses; youll need your container's ip, which can be found by `docker-machine ip default`. \n\n### option 3: ec2\n#### spin up ec2 and provision\nuse an existing image `ami-125b2c72` (in the us-west-1 region). this image contains caffe, torch, theano, keras and lasagne. [more information](http://cs231n.github.io/aws-tutorial/).\n\nyoull need the latest version of keras:\n```bash\npip install git+git://github.com/fchollet/keras.git --upgrade --no-deps\n```\n\nsince we'll be remotely calling this instance, we'll need to update security policy such that port 5000 is open to all incoming traffic.\n\nfinally, ssh into this instance, clone this repo, and run:\n```bash\ngit clone https://github.com/mynameisvinn/KerasREST\ncd KerasREST\npython server.py\n```\n\n#### client rest calls\nfrom your local machine, run `python client.py`. make sure it points to the correct ec2 instance (eg http://ec2-54-67-101-240.us-west-1.compute.amazonaws.com:5000/api) and not `localhost`.\n\nfor example:\n```python\ndef make_prediction(X_test):\n    r = requests.put(\"http://ec2-54-67-101-240.us-west-1.compute.amazonaws.com:5000/api\", json={'input': X_test})  # point to your ec2 dns\n    resp = r.json()['pred_val']\n    return resp\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmynameisvinn%2Fkerasrest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmynameisvinn%2Fkerasrest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmynameisvinn%2Fkerasrest/lists"}