{"id":24378708,"url":"https://github.com/aime-team/aime-api-server","last_synced_at":"2025-04-10T20:15:11.207Z","repository":{"id":231560283,"uuid":"724596374","full_name":"aime-team/aime-api-server","owner":"aime-team","description":"AIME API Server - Scalable AI Model Inference API Server","archived":false,"fork":false,"pushed_at":"2025-03-06T09:25:41.000Z","size":40900,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T17:55:18.454Z","etag":null,"topics":["api","deeplearning","inference","python","pytorch","tensorflow"],"latest_commit_sha":null,"homepage":"https://api.aime.info","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aime-team.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":"2023-11-28T12:06:04.000Z","updated_at":"2025-03-06T09:25:44.000Z","dependencies_parsed_at":"2024-04-22T07:47:59.662Z","dependency_job_id":"108862fc-3b40-46e6-b3f3-4ea53d02c1be","html_url":"https://github.com/aime-team/aime-api-server","commit_stats":null,"previous_names":["aime-team/aime-api-server"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aime-team%2Faime-api-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aime-team%2Faime-api-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aime-team%2Faime-api-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aime-team%2Faime-api-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aime-team","download_url":"https://codeload.github.com/aime-team/aime-api-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288631,"owners_count":21078907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","deeplearning","inference","python","pytorch","tensorflow"],"created_at":"2025-01-19T06:32:18.650Z","updated_at":"2025-04-10T20:15:11.196Z","avatar_url":"https://github.com/aime-team.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nTitle: AIME API Server\n---\n\n![AIME API Server](/docs/images/aime_api_banner.png \"AIME API Server\")\n\n# AIME API Server - The Scalable AI Model Inference API Server\n\nWith AIME API one deploys deep learning models (Pytorch, Tensorflow) through a job queue as scalable API endpoint capable of serving millions of model inference requests.\n\nTurn a console Python script to a secure and robust web API acting as your interface to the mobile, browser and desktop world.\n\n## Features\n\n* Fast - asynchronous and multi process API server\n* Scalable \u0026 Robust- distributed cluster ready architecture\n* Secure - type safe interface and input validation\n* Aggregates API requests to GPU batch jobs for maximum throughput\n* Easy integratable into exisiting Python and Tensorflow projects\n* High performance image and audio input/ouput conversion for common web formats\n* Pythonic - easily extendable in your favourite programming language\n\n## Overview of the AIME API Architecture\n\nThe AIME API server solution implements a distributed server architecture with a central API Server communicating through a job queue with a scalable GPU compute cluster. The GPU compute cluster can be heterogeneous and distributed at different locations without requiring an interconnect.\n\n![AIME API Architecture](/docs/images/aime_api_architecture.png \"AIME API Architecture\")\n\n\n### AIME API Server\n\nThe central part is the [API Server](https://github.com/aime-team/aime-api-server), an efficient asynchronous HTTP/HTTPS web server which can be used stand-alone web server or integrated into Apache, NGINX or similar web servers. It takes the client requests, load balances the requests and distributes them to the API compute workers.\n\n### Compute Workers\n\nThe model compute jobs are processed through so called compute workers which connect to the API server through a secure HTTPS interface. \n\nYou can easily turn your existing Pytorch and Tensorflow script into an API compute worker by integrating the [AIME API Worker Interface](https://github.com/aime-team/aime-api-worker-interface).\n\n### Clients\n\nClients, like web browsers, smartphones, desktop apps can easily integrating model inference API class with the [AIME API Client Interfaces](https://github.com/aime-team/aime-api-client-interfaces).\n\n\n## Example Endpoints\n\nTo illustrate the usage and capabilities of AIME API we currently run following GenAI (generative AI) demo api services:\n\n### Llama 3.0 / 3.1 / 3.3 Instruct Chat\n\n[![AIME Llama 3.3 Chat Demo](/docs/images/aime_api_demo-llm3-3-chat_banner.png \"AIME Llama 3.3 Chat Demo\")](https://api.aime.info/llama3-chat/)\n\nChat with 'Steve', our Llama 3.3 70B based instruct chat-bot.\n\n* AIME Demo Server: [Llama 3.3 Chat](https://api.aime.info/llama3-chat/)\n* Your Local Server: [Llama 3.x Chat](/llama3-chat/)\n* Source: [https://github.com/aime-labs/llama3_chat](https://github.com/aime-labs/llama3_chat)\n\n### Mixtral 8x7B / 8x22B Instruct Chat\n\n[![AIME Mixtral Chat Demo](/docs/images/aime_api_demo-mixtral-chat_banner.png \"AIME Mixtral Instruct Chat Demo\")](https://api.aime.info/mixtral-chat/)\n\nChat with 'Chloe', our Mixtral 8x7B or 8X22B based instruct chat-bot.\n\n* AIME Demo Server: [Mixtral Chat](https://api.aime.info/mixtral-chat/)\n* Your Local Server: [Mixtral Chat](/mixtral-chat/)\n* Source: [https://github.com/aime-labs/mixtral_chat](https://github.com/aime-labs/mixtral_chat)\n\n### FLUX.1-Dev\n\n[![AIME FLUX.1-Dev Demo](/docs/images/aime_api_demo-flux_banner.png \"AIME FLUX.1-Dev Demo\")](https://api.aime.info/flux/)\n\nCreate photo realistic images with Black Forest Labs FLUX.1-Dev.\n\n* AIME Demo Server: [FLUX.1-Dev](https://api.aime.info/flux/)\n* Your Local Server: [FLUX.1-Dev](/flux/)\n* Source: [https://github.com/aime-labs/flux](https://github.com/aime-labs/flux)\n\n### Stable Diffusion 3\n\n[![AIME Stable Diffusion 3 Demo](/docs/images/aime_api_demo-sd3_banner.png \"AIME Stable Diffusion 3 Demo\")](https://api.aime.info/sd3/)\n\nCreate photo realistic images with Stable Diffusion 3.\n\n* AIME Demo Server: [Stable Diffusion 3](https://api.aime.info/sd3/)\n* Your Local Server: [Stable Diffusion 3](/sd3/)\n* Source: [https://github.com/aime-labs/stable_diffusion_3](https://github.com/aime-labs/stable_diffusion_3)\n\n\n### Seamless Communication\n\n[![AIME Seamless Communication Demo](/docs/images/aime_api_demo-seamless-translate_banner.png \"AIME Seamless Communication Demo\")](https://api.aime.info/sc-m4tv2/)\n\nTranslate between 36 languages in near realtime: Text-to-Text, Speech-to-Text, Text-to-Speech and Speech-to-Speech! \n\n* AIME Demo Server: [Seamless Communication](https://api.aime.info/sc-m4tv2/)\n* Your local Server: [Seamless Communication](/sc-m4tv2/)\n* Source: [https://github.com/aime-labs/seamless_communication](https://github.com/aime-labs/seamless_communication)\n\n\n### Implementation for following model endpoints are also available\n\n#### Stable Diffusion 3.5\n\nCreate photo realistic images from text prompts.\n\n* Local Endpoint: [Stable Diffusion 3.5](/stable_diffusion_3_5/)\n* Worker Implementation: [https://github.com/aime-labs/aime-api_stable_diffusion_3_5](https://github.com/aime-labs/aime-api_stable_diffusion_3_5)\n\n#### Stable Diffusion XL\n\nCreate photo realistic images from text prompts.\n\n* Local Endpoint: [Stable Diffusion XL](/sdxl-txt2img/)\n* Worker Implementation: [https://github.com/aime-labs/stable_diffusion_xl](https://github.com/aime-labs/stable_diffusion_xl)\n\n#### Llama2 Chat\n\nChat with 'Dave', the Llama2 based chat-bot. \n\n* Local Endpoint: [LLama2 Chat](/llama2-chat/)\n* Worker Implementation: [https://github.com/aime-labs/llama2_chat](https://github.com/aime-labs/llama2_chat)\n\n#### Tortoise TTS\n\nTortoise TTS: high quality Text-To-Speech Demo \n\n* Local Endpoint: [Tortoise TTS](/tts-tortoise/)\n* Worker Implementation: [https://github.com/aime-labs/tortoise-tts](https://github.com/aime-labs/tortoise-tts)\n\n\n## How to setup and start the AIME API Server\n\n### Setup the environment\n\nWe recommend creating a virtual environment for local development. Create and activate a virtual environment, like 'venv' with:\n\n```bash\npython3 -m venv venv\nsource ./venv/bin/activate\n```\n\nDownload or clone the AIME API server:\n\n```bash\ngit clone --recurse-submodules https://github.com/aime-team/aime-api-server.git\n```\n\nAlternative, for excluding [Worker interface](https://github.com/aime-team/aime-api-worker-interface) and [Client interfaces](https://github.com/aime-team/aime-api-client-interfaces) submodules, which are not needed to run the API server itself, use:\n\n```bash\ngit clone https://github.com/aime-team/aime-api-server.git \n```\n\nThen install required pip packages:\n\n```bash\npip install -r requirements.txt\n```\n\n### Optional: install ffmpeg (required for image and audio conversion)\n\nUbuntu/Debian:\n\n```bash\nsudo apt install ffmpeg\n```\n\n### Starting the server\n\nTo start the API server run:\n\n```bash\npython3 run api_server.py [-H HOST] [-p PORT] [-c EP_CONFIG] [--dev]\n```\n\nThe server is booting and loading the example endpoints configurations defined in the \"/endpoints\" directory.\n\nWhen started it is reachable at http://localhost:7777 (or the port given). As default this README.md file is serverd. The example endpoints are available and are taking requests.\n\nThe server is now ready to connect corresponding compute workers.\n\n\n## Compute Workers\n\nYou can easily turn your existing Pytorch and Tensorflow script into an API compute worker by integrating the [AIME API Worker Interface](https://github.com/aime-team/aime-api-worker-interface).\n\nFollowing example workers implementations are available as open source, which easily can be be adapted to similair use cases:\n\n### How to run a Llama3 Chat Worker (Large Language Model Chat)\n\n[https://github.com/aime-labs/llama3_chat](https://github.com/aime-labs/llama3_chat)\n\n\n### How to run a Stable Diffusion Worker (Image Generation)\n\n[https://github.com/aime-labs/stable_diffusion_xl](https://github.com/aime-labs/stable_diffusion_xl)\n\n\n### How to run a Seamless Communication Worker (Text2Text, SpeechText, Text2Speech, Speech2Speech)\n\n[https://github.com/aime-labs/seamless_communication](https://github.com/aime-labs/seamless_communication)\n\n## Available Client Interfaces\n\n### Javascript\n\nSimple single call example for an AIME API Server request on endpoint LlaMa 2 with Javascript:\n\n```html\n\n\u003cscript src=\"/js/model_api.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nfunction onResultCallback(data) {\n\tconsole.log(data.text) // print generated text to console\n}\n\nparams = new Object({\n\ttext : 'Your text prompt' \n});\n\ndoAPIRequest('llama2_chat', params, onResultCallback, 'user_name', 'user_key');\n\u003c/script\u003e\n```\n\n### Python\n\nSimple synchronous single call example for an AIME API Server request on endpoint LlaMa 2 with Python:\n\n```python\n\naime_api_client_interface import do_api_request \n\nparams = {'text': 'Your text prompt'}\n\nresult = do_api_request('https://api.aime.info', 'llama2_chat', params, 'user_name', 'user_key')\nprint(result.get('text')) # print generated text to console\n```\n\n### More to come...\n\nWe are currently working on sample interfaces for: iOS, Android, Java, PHP, Ruby, C/C++, \n\n## Documentation\n\nFor more information about the AIME read our [blog article](https://www.aime.info/blog/en/aime-api-server/) about [AIME API](https://api.aime.info/)\n\nThe AIME API is free of charge for AIME customers. Details can be found in the [LICENSE](https://github.com/aime-team/aime-api-server/blob/main/LICENSE) file. We look forward to hearing from you regarding collaboration or licensing on other devices: hello@aime.info.\n\nOr consult the [AIME API documentation](https://api.aime.info/docs/index.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faime-team%2Faime-api-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faime-team%2Faime-api-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faime-team%2Faime-api-server/lists"}