{"id":11708,"date":"2022-09-20T19:06:10","date_gmt":"2022-09-20T19:06:10","guid":{"rendered":"https:\/\/predictly.se\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/"},"modified":"2024-05-08T11:46:45","modified_gmt":"2024-05-08T11:46:45","slug":"serve-any-xgboost-model-with-fastapi-in-less-that-40-lines","status":"publish","type":"post","link":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/","title":{"rendered":"Serve any XGBoost model with FastAPI in less that 40 lines"},"content":{"rendered":"<blockquote><p>While staying PEP 8 compliant<\/p><\/blockquote>\n<p>As I iterate over my models, they usually have a varying feature set. While testing I like to serve my models in a micro service for easy integration with my other services. Keeping the model-server up to date with the ever changing model has proven to be quite time consuming due to the changes in the features. I found myself spending more and more time tinkering with the model server than the actual model. Something needed to change.<\/p>\n<p><img class=\"lazyload\" decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27720%27%20height%3D%27388%27%20viewBox%3D%270%200%20720%20388%27%3E%3Crect%20width%3D%27720%27%20height%3D%27388%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/xgboost-fastapi.png\" alt=\"XGBoost FastAPI\"><\/p>\n<p><a href=\"https:\/\/fastapi.tiangolo.com\" target=\"_blank\" rel=\"noopener\">FastAPI<\/a> is a web framework for building APIs in python. It has become my go to framework when serving my models. It requires a minimal amount of code, which in turn decreases the time required for development and testing and also reduces the risk for errors.<\/p>\n<p>Using FastAPI on <a href=\"https:\/\/github.com\/encode\/uvicorn\" target=\"_blank\" rel=\"noopener\">uvicorn<\/a>, I wrote a model-serving service which loads my XGBoost model, creates a class for a simple REST endpoint which validates input data defined by the model itself, performs the prediction and returns the result.<\/p>\n<p>All this with automatic OpenAPI documentation and argument validation (courtesy of FastAPI) in less than 40 lines of python, while also staying <a href=\"https:\/\/peps.python.org\/pep-0008\/\" target=\"_blank\" rel=\"noopener\">PEP8<\/a> compliant.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport pickle\nfrom pydoc import locate\nfrom typing import List\n\nimport numpy as np\nimport uvicorn\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel\n\nmodel = pickle.load(open(&quot;model.dat&quot;, &quot;rb&quot;))\n\n\ndef create_type_instance(type_name: str):\n  return locate(type_name).__call__()\n\n\ndef get_features_dict(model):\n  feature_names = model.get_booster().feature_names\n  feature_types = list(map(create_type_instance, model.get_booster().feature_types))\n  return dict(zip(feature_names, feature_types))\n\n\ndef create_input_features_class(model):\n  return type(&quot;InputFeatures&quot;, (BaseModel,), get_features_dict(model))\n\n\nInputFeatures = create_input_features_class(model)\napp = FastAPI()\n\n\n@app.post(&quot;\/predict&quot;, response_model=List)\nasync def predict_post(data: List&#x5B;InputFeatures]):\n  return model.predict(np.asarray(&#x5B;list(data.__dict__.values()) for data in datas])).tolist()\n\n\nif __name__ == &quot;__main__&quot;:\n  print(get_features_dict(model))\n  uvicorn.run(app, host=&quot;0.0.0.0&quot;, port=8080)\n<\/pre>\n<p>To allow FastAPI to generate the OpenAPI doc and model validation, we must supply a type hint to the input argument of the function. On line 32 I define the input argument must be a <i>List<\/i> of <i>InputFeatures<\/i>.<\/p>\n<p><i>InputFeatures<\/i> is a class which I create dynamically during runtime based on my models feature set. In this example I use an XGBoost model, but any model can be used, as long as the <i>get_features_dict<\/i> function is adjusted accordingly.<\/p>\n<p>To create a new Class i use the type function which either returns the type of the object or returns a new <i>type<\/i> object based on the arguments passed.<\/p>\n<p>On line 24 I pass in three arguments, first the name of the class, in this case &#8220;InputFeatures&#8221;. Second I supply a tuple containing the Base classes for my new class. In this case i supply the pydantic <i>BaseModel<\/i>, which will be used by FastAPI for argument validation and OpenAPI docs. Lastly I supply a dict which contains the body definition of the class. This is created using the <i>get_features_dict<\/i> function.<\/p>\n<h6>get_features_dict<\/h6>\n<p>This function will vary depending on your model, in this example I&#8217;m using an XGBoost model which I load memory using <a href=\"https:\/\/docs.python.org\/3\/library\/pickle.html\" target=\"_blank\" rel=\"noopener\">pickle<\/a> on line 10.<\/p>\n<p>XGBoost has functions which allows me to extract both the feature names and a string value of the type of the feature.<\/p>\n<p>I can use this string value, for example float and pass it to the locate function from the <i>pydoc<\/i> module, to get the class type of matching string. I then invoke __call__ <i>()<\/i> to create an instance of the type. I then zip the two lists together to create a dict.<\/p>\n<p>For a model with 8 numerical features the resulting dict should look something like this<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  &#039;feat_0&#039;: 0.0,\n  &#039;feat_1&#039;: 0.0,\n  &#039;feat_2&#039;: 0.0,\n  &#039;feat_3&#039;: 0.0,\n  &#039;feat_4&#039;: 0.0,\n  feat_5&#039;: 0.0,\n  &#039;feat_6&#039;: 0.0,\n  feat_7&#039;: 0.0\n}\n<\/pre>\n<p>This allows the type function to correctly type the fields in our new class, which in turn allows FastAPI to generate argument validation and documentation!<\/p>\n<p>Before the model can do a prediction, it must first get the data in a format it can handle. On line 33 I simply use the built in __dict__ <i>()<\/i> method to convert the <i>InputFeature<\/i> to a dict. I then call <i>values(<\/i> ) to get a the <i>dict_values<\/i>, which in turn is turned to a simple list, which can then be passed to <i>numpys asarray<\/i> function to convert our List of <i>InputFeatures<\/i> to a <i>numpy ndarray<\/i> which the model can handle.<\/p>\n<p>To expose the model I define a REST endpoint on line 31-32 with the function <i>predict_post<\/i>. Using FastAPI annotations, I can define it as a POST endpoint with a path and a response type. The <i>async<\/i> keyword signals to the python interpreter that the function can run concurrently, allowing multiple requests to the service to be processed at the same time.<\/p>\n<p>Last on line 36 I define the services main loop, which is just running a FastAPI app on uvicorn on port 8080.<\/p>\n<p>Run the application and navigate to localhost:8080\/doc to view the OpenAPI UI and test your brand new model server!<\/p>\n<p><img class=\"lazyload\" decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27720%27%20height%3D%27478%27%20viewBox%3D%270%200%20720%20478%27%3E%3Crect%20width%3D%27720%27%20height%3D%27478%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/fastapi-1.png\" alt=\"FastAPI-1\"><br \/>\nYou can view the model for the <i>InputFeatures<\/i> and even try out the predict endpoint. If you supply broken or invalid data, you will get a pretty 422 response with detailed description on what went wrong.<\/p>\n<p>Now imagine you do some more EDA and make some new discoveries. So you change the input feature set. Simply switch the model.dat file and restart the model server!<\/p>\n<p><img class=\"lazyload\" decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27720%27%20height%3D%27458%27%20viewBox%3D%270%200%20720%20458%27%3E%3Crect%20width%3D%27720%27%20height%3D%27458%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/fastapi-2.png\" alt=\"FastAPI-2\"><\/p>\n<p>And just like that your model server is up to date with the new version of your model!<\/p>\n<h6>Summary<\/h6>\n<p>FastAPI enables you to easily, and rapidly expose any machine learning model for prediction in a scalable manner. In less than 40 lines of code. Reducing the development time, cost and risk of errors, allowing you to focus on model development rather than model serving.<\/p>\n<p>You are still stuck with the issue of changing input features for the caller of the predict endpoint, but I&#8217;ll leave that problem for the next article!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Speed up model testing by easily serving them using FastAPI<\/p>\n","protected":false},"author":7,"featured_media":11468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"cybocfi_hide_featured_image":"","footnotes":""},"categories":[110,113,112],"tags":[],"class_list":["post-11708","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-en","category-machine-learning-en","category-xgboost-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Serve any XGBoost model with FastAPI in less that 40 lines &#8211; Predictly<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Serve any XGBoost model with FastAPI in less that 40 lines &#8211; Predictly\" \/>\n<meta property=\"og:description\" content=\"Speed up model testing by easily serving them using FastAPI\" \/>\n<meta property=\"og:url\" content=\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/\" \/>\n<meta property=\"og:site_name\" content=\"Predictly\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/predictly.se\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-20T19:06:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-08T11:46:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python-1024x636.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"636\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Simon Lind\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@predictly_se\" \/>\n<meta name=\"twitter:site\" content=\"@predictly_se\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon Lind\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/\"},\"author\":{\"name\":\"Simon Lind\",\"@id\":\"https:\/\/predictly.se\/en\/#\/schema\/person\/036b901e4ff56b4d3d81b0b0d720315a\"},\"headline\":\"Serve any XGBoost model with FastAPI in less that 40 lines\",\"datePublished\":\"2022-09-20T19:06:10+00:00\",\"dateModified\":\"2024-05-08T11:46:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/\"},\"wordCount\":1004,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/predictly.se\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png\",\"articleSection\":[\"Data\",\"Machine Learning\",\"XGBoost\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/\",\"url\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/\",\"name\":\"Serve any XGBoost model with FastAPI in less that 40 lines &#8211; Predictly\",\"isPartOf\":{\"@id\":\"https:\/\/predictly.se\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png\",\"datePublished\":\"2022-09-20T19:06:10+00:00\",\"dateModified\":\"2024-05-08T11:46:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage\",\"url\":\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png\",\"contentUrl\":\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png\",\"width\":1429,\"height\":888},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/predictly.se\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Okategoriserad\",\"item\":\"https:\/\/predictly.se\/en\/insikter\/okategoriserad\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Serve any XGBoost model with FastAPI in less that 40 lines\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/predictly.se\/en\/#website\",\"url\":\"https:\/\/predictly.se\/en\/\",\"name\":\"Predictly\",\"description\":\"Professional IT services\",\"publisher\":{\"@id\":\"https:\/\/predictly.se\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/predictly.se\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/predictly.se\/en\/#organization\",\"name\":\"Predictly\",\"url\":\"https:\/\/predictly.se\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/predictly.se\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/10\/Logotype1-mobil.svg\",\"contentUrl\":\"https:\/\/predictly.se\/wp-content\/uploads\/2022\/10\/Logotype1-mobil.svg\",\"width\":532,\"height\":96,\"caption\":\"Predictly\"},\"image\":{\"@id\":\"https:\/\/predictly.se\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/predictly.se\",\"https:\/\/x.com\/predictly_se\",\"https:\/\/www.linkedin.com\/company\/predictly\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/predictly.se\/en\/#\/schema\/person\/036b901e4ff56b4d3d81b0b0d720315a\",\"name\":\"Simon Lind\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/predictly.se\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4002a927f066edcc5d52d440c9add6933e6a177a60c830e67ae732aac791de4d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4002a927f066edcc5d52d440c9add6933e6a177a60c830e67ae732aac791de4d?s=96&d=mm&r=g\",\"caption\":\"Simon Lind\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Serve any XGBoost model with FastAPI in less that 40 lines &#8211; Predictly","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/","og_locale":"en_US","og_type":"article","og_title":"Serve any XGBoost model with FastAPI in less that 40 lines &#8211; Predictly","og_description":"Speed up model testing by easily serving them using FastAPI","og_url":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/","og_site_name":"Predictly","article_publisher":"https:\/\/www.facebook.com\/predictly.se","article_published_time":"2022-09-20T19:06:10+00:00","article_modified_time":"2024-05-08T11:46:45+00:00","og_image":[{"width":1024,"height":636,"url":"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python-1024x636.png","type":"image\/png"}],"author":"Simon Lind","twitter_card":"summary_large_image","twitter_creator":"@predictly_se","twitter_site":"@predictly_se","twitter_misc":{"Written by":"Simon Lind","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#article","isPartOf":{"@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/"},"author":{"name":"Simon Lind","@id":"https:\/\/predictly.se\/en\/#\/schema\/person\/036b901e4ff56b4d3d81b0b0d720315a"},"headline":"Serve any XGBoost model with FastAPI in less that 40 lines","datePublished":"2022-09-20T19:06:10+00:00","dateModified":"2024-05-08T11:46:45+00:00","mainEntityOfPage":{"@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/"},"wordCount":1004,"commentCount":0,"publisher":{"@id":"https:\/\/predictly.se\/en\/#organization"},"image":{"@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage"},"thumbnailUrl":"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png","articleSection":["Data","Machine Learning","XGBoost"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/","url":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/","name":"Serve any XGBoost model with FastAPI in less that 40 lines &#8211; Predictly","isPartOf":{"@id":"https:\/\/predictly.se\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage"},"image":{"@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage"},"thumbnailUrl":"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png","datePublished":"2022-09-20T19:06:10+00:00","dateModified":"2024-05-08T11:46:45+00:00","breadcrumb":{"@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#primaryimage","url":"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png","contentUrl":"https:\/\/predictly.se\/wp-content\/uploads\/2022\/09\/python.png","width":1429,"height":888},{"@type":"BreadcrumbList","@id":"https:\/\/predictly.se\/en\/serve-any-xgboost-model-with-fastapi-in-less-that-40-lines\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/predictly.se\/en\/"},{"@type":"ListItem","position":2,"name":"Okategoriserad","item":"https:\/\/predictly.se\/en\/insikter\/okategoriserad\/"},{"@type":"ListItem","position":3,"name":"Serve any XGBoost model with FastAPI in less that 40 lines"}]},{"@type":"WebSite","@id":"https:\/\/predictly.se\/en\/#website","url":"https:\/\/predictly.se\/en\/","name":"Predictly","description":"Professional IT services","publisher":{"@id":"https:\/\/predictly.se\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/predictly.se\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/predictly.se\/en\/#organization","name":"Predictly","url":"https:\/\/predictly.se\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/predictly.se\/en\/#\/schema\/logo\/image\/","url":"https:\/\/predictly.se\/wp-content\/uploads\/2022\/10\/Logotype1-mobil.svg","contentUrl":"https:\/\/predictly.se\/wp-content\/uploads\/2022\/10\/Logotype1-mobil.svg","width":532,"height":96,"caption":"Predictly"},"image":{"@id":"https:\/\/predictly.se\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/predictly.se","https:\/\/x.com\/predictly_se","https:\/\/www.linkedin.com\/company\/predictly\/"]},{"@type":"Person","@id":"https:\/\/predictly.se\/en\/#\/schema\/person\/036b901e4ff56b4d3d81b0b0d720315a","name":"Simon Lind","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/predictly.se\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4002a927f066edcc5d52d440c9add6933e6a177a60c830e67ae732aac791de4d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4002a927f066edcc5d52d440c9add6933e6a177a60c830e67ae732aac791de4d?s=96&d=mm&r=g","caption":"Simon Lind"}}]}},"_links":{"self":[{"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/posts\/11708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/comments?post=11708"}],"version-history":[{"count":1,"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/posts\/11708\/revisions"}],"predecessor-version":[{"id":11719,"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/posts\/11708\/revisions\/11719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/media\/11468"}],"wp:attachment":[{"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/media?parent=11708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/categories?post=11708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/predictly.se\/en\/wp-json\/wp\/v2\/tags?post=11708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}