{"id":19165362,"url":"https://github.com/underneathall/pinferencia_docs","last_synced_at":"2026-02-26T23:32:01.641Z","repository":{"id":105667800,"uuid":"574290226","full_name":"underneathall/pinferencia_docs","owner":"underneathall","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-05T09:33:25.000Z","size":7244,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T19:04:14.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/underneathall.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-12-05T01:11:34.000Z","updated_at":"2022-12-05T07:42:31.000Z","dependencies_parsed_at":"2023-05-06T12:01:21.108Z","dependency_job_id":null,"html_url":"https://github.com/underneathall/pinferencia_docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/underneathall/pinferencia_docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/underneathall%2Fpinferencia_docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/underneathall%2Fpinferencia_docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/underneathall%2Fpinferencia_docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/underneathall%2Fpinferencia_docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/underneathall","download_url":"https://codeload.github.com/underneathall/pinferencia_docs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/underneathall%2Fpinferencia_docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29876937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T22:37:10.609Z","status":"ssl_error","status_checked_at":"2026-02-26T22:37:09.019Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-09T09:27:36.993Z","updated_at":"2026-02-26T23:32:01.620Z","avatar_url":"https://github.com/underneathall.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Pinferencia](/docs/assets/images/logo_header.png)\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003cem\u003eSimple, but Powerful.\u003c/em\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"https://lgtm.com/projects/g/underneathall/pinferencia/context:python\"\u003e\r\n        \u003cimg alt=\"Language grade: Python\" src=\"https://img.shields.io/lgtm/grade/python/g/underneathall/pinferencia.svg?logo=lgtm\u0026logoWidth=18\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://codecov.io/gh/underneathall/pinferencia\"\u003e\r\n        \u003cimg src=\"https://codecov.io/gh/underneathall/pinferencia/branch/main/graph/badge.svg?token=M7J77E4IWC\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache_2.0-blue.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://pypi.org/project/pinferencia/\"\u003e\r\n        \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/pinferencia?color=green\"\u003e\r\n    \u003c/a\u003e\r\n    \u003cimg alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/pinferencia\"\u003e\r\n\u003c/p\u003e\r\n\r\n---\r\n\r\n\u003cp align=\"center\"\u003e\r\n\u003ca href=\"https://pinferencia.underneathall.app\" target=\"_blank\"\u003e\r\n    English Doc\r\n\u003c/a\u003e |\r\n\u003ca href=\"https://pinferencia.underneathall.app/zh\" target=\"_blank\"\u003e\r\n    中文文档\r\n\u003c/a\u003e|\r\n\u003ca href=\"./Readme.zh.md\" target=\"_blank\"\u003e\r\n    中文Readme\r\n\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003cem\u003eHelp wanted. Translation, rap lyrics, all wanted. Feel free to create an issue.\u003c/em\u003e\r\n\u003c/p\u003e\r\n\r\n---\r\n\r\n**Pinferencia** tries to be the simplest machine learning inference server ever!\r\n\r\n**Three extra lines and your model goes online**.\r\n\r\nServing a model with GUI and REST API has never been so easy.\r\n\r\n![Pinferencia-GUI](/docs/assets/images/examples/translation-gui.png)\r\n\r\n![Pinferencia-REST API](/docs/assets/images/examples/translate-app.png)\r\n\r\nIf you want to\r\n\r\n- give your model a **GUI** and **REST API**\r\n- find a **simple but robust** way to serve your model\r\n- write **minimal** codes while maintain controls over you service\r\n- **avoid** any **heavy-weight** solutions\r\n- **compatible** with other tools/platforms\r\n\r\nYou're at the right place.\r\n\r\n## Features\r\n\r\n**Pinferencia** features include:\r\n\r\n- **Fast to code, fast to go alive**. Minimal codes needed, minimal transformation needed. Just based on what you have.\r\n- **100% Test Coverage**: Both statement and branch coverages, no kidding. Have you ever known any model serving tool so seriously tested?\r\n- **Easy to use, easy to understand**.\r\n- **A pretty and clean GUI** out of box.\r\n- **Automatic API documentation page**. All API explained in details with online try-out feature.\r\n- **Serve any model**, even a single function can be served.\r\n- **Support Kserve API**, compatible with Kubeflow, TF Serving, Triton and TorchServe. There is no pain switching to or from them, and **Pinferencia** is much faster for prototyping!\r\n\r\n## Install\r\n\r\n### Recommend\r\n\r\n```bash\r\npip install \"pinferencia[streamlit]\"\r\n```\r\n\r\n### Backend Only\r\n\r\n```bash\r\npip install \"pinferencia\"\r\n```\r\n\r\n## Quick Start\r\n\r\n**Serve Any Model**\r\n\r\n```python title=\"app.py\"\r\nfrom pinferencia import Server\r\n\r\n\r\nclass MyModel:\r\n    def predict(self, data):\r\n        return sum(data)\r\n\r\n\r\nmodel = MyModel()\r\n\r\nservice = Server()\r\nservice.register(model_name=\"mymodel\", model=model, entrypoint=\"predict\")\r\n```\r\n\r\nJust run:\r\n\r\n```\r\npinfer app:service\r\n```\r\n\r\nHooray, your service is alive. Go to http://127.0.0.1:8501/ and have fun.\r\n\r\n**Any Deep Learning Models?** Just as easy. Simple train or load your model, and register it with the service. Go alive immediately.\r\n\r\n**Hugging Face**\r\n\r\nDetails: [HuggingFace Pipeline - Vision](https://pinferencia.underneathall.app/ml/huggingface/pipeline/vision/)\r\n\r\n```python title=\"app.py\" linenums=\"1\"\r\nfrom transformers import pipeline\r\n\r\nfrom pinferencia import Server\r\n\r\nvision_classifier = pipeline(task=\"image-classification\")\r\n\r\n\r\ndef predict(data):\r\n    return vision_classifier(images=data)\r\n\r\n\r\nservice = Server()\r\nservice.register(model_name=\"vision\", model=predict)\r\n\r\n```\r\n\r\n**Pytorch**\r\n\r\n```python title=\"app.py\"\r\nimport torch\r\n\r\nfrom pinferencia import Server\r\n\r\n\r\n# train your models\r\nmodel = \"...\"\r\n\r\n# or load your models (1)\r\n# from state_dict\r\nmodel = TheModelClass(*args, **kwargs)\r\nmodel.load_state_dict(torch.load(PATH))\r\n\r\n# entire model\r\nmodel = torch.load(PATH)\r\n\r\n# torchscript\r\nmodel = torch.jit.load('model_scripted.pt')\r\n\r\nmodel.eval()\r\n\r\nservice = Server()\r\nservice.register(model_name=\"mymodel\", model=model)\r\n```\r\n\r\n**Tensorflow**\r\n\r\n```python title=\"app.py\"\r\nimport tensorflow as tf\r\n\r\nfrom pinferencia import Server\r\n\r\n\r\n# train your models\r\nmodel = \"...\"\r\n\r\n# or load your models (1)\r\n# saved_model\r\nmodel = tf.keras.models.load_model('saved_model/model')\r\n\r\n# HDF5\r\nmodel = tf.keras.models.load_model('model.h5')\r\n\r\n# from weights\r\nmodel = create_model()\r\nmodel.load_weights('./checkpoints/my_checkpoint')\r\nloss, acc = model.evaluate(test_images, test_labels, verbose=2)\r\n\r\nservice = Server()\r\nservice.register(model_name=\"mymodel\", model=model, entrypoint=\"predict\")\r\n```\r\n\r\nAny model of any framework will just work the same way. Now run `uvicorn app:service --reload` and enjoy!\r\n\r\n\r\n## Contributing\r\n\r\nIf you'd like to contribute, details are [here](./CONTRIBUTING.md)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funderneathall%2Fpinferencia_docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funderneathall%2Fpinferencia_docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funderneathall%2Fpinferencia_docs/lists"}