{"id":26187674,"url":"https://github.com/socaity/socaity","last_synced_at":"2025-04-15T00:56:00.615Z","repository":{"id":277440217,"uuid":"759750951","full_name":"SocAIty/socaity","owner":"SocAIty","description":"SDK for generative AI. ","archived":false,"fork":false,"pushed_at":"2025-03-23T09:26:55.000Z","size":25405,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T00:55:54.313Z","etag":null,"topics":["3d-generation","api","artificial-intelligence","audio-generation","bark","clip","deepseek-r1","flux","generative-ai","hosting","image-captioning","image-generation","inference-api","llama3","llm","runpod","speech-synthesis","stable-diffusion","text-to-speech","video-generation"],"latest_commit_sha":null,"homepage":"https://www.socaity.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SocAIty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-02-19T09:12:19.000Z","updated_at":"2025-03-23T09:26:58.000Z","dependencies_parsed_at":"2025-02-14T00:31:22.369Z","dependency_job_id":null,"html_url":"https://github.com/SocAIty/socaity","commit_stats":null,"previous_names":["socaity/socaity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocAIty%2Fsocaity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocAIty%2Fsocaity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocAIty%2Fsocaity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocAIty%2Fsocaity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SocAIty","download_url":"https://codeload.github.com/SocAIty/socaity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986280,"owners_count":21194025,"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":["3d-generation","api","artificial-intelligence","audio-generation","bark","clip","deepseek-r1","flux","generative-ai","hosting","image-captioning","image-generation","inference-api","llama3","llm","runpod","speech-synthesis","stable-diffusion","text-to-speech","video-generation"],"created_at":"2025-03-11T23:51:05.114Z","updated_at":"2025-04-15T00:56:00.602Z","avatar_url":"https://github.com/SocAIty.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"  \u003ch1 align=\"center\" style=\"margin-top:-25px\"\u003eSocAIty SDK\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg align=\"center\" src=\"docs/socaity_icon.png\" height=\"200\" /\u003e\n\u003c/p\u003e\n  \u003ch2 align=\"center\" style=\"margin-top:-10px\"\u003eBuild AI-powered applications with ease \u003c/h2\u003e\n\n\nThe SDK provides generative models and AI tools across all domains including text, audio, image and more. \nOur APIs and SDK allows you to run models as simple python functions. No GPU or AI knowledge required.\nBuild your dream application by composing different models together.\n\nIf you are a Software Engineer, Game Developer, Artist, Content Creator and you want to automate with AI this SDK is for you.\n\nFor an overview of all models and to obtain an API key visit [socaity.ai](https://www.socaity.ai)\n\nRun models as if they were python functions nomatter where they are deployed:\n- hosted on socaity servers (default)\n- deployed on your localhost / your own server- hybrid deployment\n\nYou can focus on your app, while we handle all the complicated stuff under the hood.\n\n\u003chr /\u003e\n\nQuicklinks:\n- [Quick Start](#quick-start) contains a simple example to get you started\n- [Models Zoo](#model-zoo) an overview of all models.\n- [Working locally or with other providers](#working-locally-or-with-other-providers)\n\n\u003chr /\u003e\n\n# Getting started\n\n## Installation\nInstall the package from PyPi\n```python\npip install socaity\n```\n\n## Authentication\n\nFor using socaity.ai services you need to set the environment variable `SOCAITY_API_KEY`.\nYou can obtain an API key from [socaity.ai](https://www.socaity.ai) after signing up.\nNow you are ready to use the SDK.\n\n**Alternatively** you can set the API key in your code when using the SDK. \nWe don't recommend this, as it a common mistake to push your code including your API key to a public repository.\n```python\nfrom socaity import FluxSchnell\nflux_schnell = FluxSchnell(service=\"socaity\", api_key=\"sai..your_api_key\")\n```\n\nIf you **instead** want to directly communicate with your runpod services or replicate you can set \nthe environment variable `RUNPOD_API_KEY` or `REPLICATE_API_KEY`.\nWhen initializing your ModelClient you can additionally pass which provider you want to use by using \"service\" parameter.\n\n# Quick start\n\nImport a model from the model-zoo or just use the simple API (text2img, text2speech etc.)\n```python\nfrom socaity import FluxSchnell, text2speech, text2img\n```\nThen you can use it as a function\n```python\nflux_schnell = FluxSchnell().text2img(\"A beautiful sunset in the mountains\")\nmy_image = text2img(\"A beautiful sunset in the mountains\").get_result()\n```\n\n### Example 1: Combine llm, text2img and text2speech\n\nWe will use different models to showcase how to create for example a perfect combination for a blog.\n```python\nfrom socaity import DeepSeekR1, text2voice, text2img\n\ndeepseek = DeepSeekR1()\npoem = deepseek.chat(\"Write a poem with 3 sentences why a SDK is so much better than plain web requests.\").get_result()\npoem = deepseek.pretty(poem)\n\naudio = text2voice(poem, model=\"speechcraft\", voice=\"hermine\")\n\nmy_image_prompt = \"\"\"\nA robot enjoying a stunning sunset in the alps. In the clouds is written in big letters \"SOCAITY SDK\".\nThe sky is lit with deep purple and lime colors. It is a wide-shot.\nThe artwork is striking and cinematic, showcasing a vibrant neon-green lime palette, rendered in an anime-style illustration with 4k detail. \nInfluenced by the artistic styles of Simon Kenny, Giorgetto Giugiaro, Brian Stelfreeze, and Laura Iverson.\n\"\"\"\n\nimage = text2img(text=my_image_prompt, model=\"flux-schnell\", num_outputs=1)\naudio.get_result().save(\"sdk_poem.mp3\")\nimage.get_result().save(\"sdk_poem.png\")\n```\nThis results in something like this:\n\n\n### Jobs vs. Results\n\nWhen you invoke an service, internally we use threading and asyncio to check the socaity endpoints for the result.\nThis makes it possible to run multiple services in parallel and is very efficient.\n```python\n# the base method always returns a job\nd_job = deepseek.chat(\"Write a poem with 3 sentences why a SDK is so much better than plain web requests.\")\n# in the meantime you can call other services or do what you want\n... do other things here ... \n# when you need the result you can call get_result()\npoem = d_job.get_result()\n```\nTo simplify even more you can use the helper functions with the argument `await_result=True` then the function will block until the result is available.\n```python\nfrom socaity import chat \npoem = chat(\"Write a poem with 3 sentences why a SDK is so much better than plain web requests.\", await_result=True)\n```\n\n\nhttps://github.com/user-attachments/assets/978ee377-3ceb-4a87-add5-daee15306231\n\n\n\n# Model zoo\n\nA curated list of hosted models you always find on [socaity.ai](https://www.socaity.ai).\n\nTo start here's a list of some of the models you can use with the SDK.\nJust import them with ```from socaity import ...``` to use them.\n\n### Text domain\n- DeepSeek-R1\n- LLama3 Family (8b, 13b, 70b models. Codellama and Instruct models)\n\n### Image domain\n- FluxSchnell (Text2Image)\n- SAM2 (Image and video segmentation)\n- TencentArc Photomaker\n\n### Audio domain\n- [SpeechCraft](https://github.com/SocAIty/SpeechCraft) (Text2Voice, VoiceCloning)\n\n\nNote that we have just launched the startup. Expect new models coming highly frequently.\n\n\n# Working locally or with other providers\n\nAny service that is [fastSDK](https://github.com/SocAIty/fastsdk) compatible  (openAPI / [fastTaskAPI](https://github.com/SocAIty/FastTaskAPI), replicate and [runpod](https://www.runpod.io/)) \ncan be used with this package.\n\nModel deployment type    | Description                                                    | Pros                                           | Cons\n-------------            |----------------------------------------------------------------|------------------------------------------------| ------------\nLocally         | Install genAI packages on your machine and use it with socaity | Free, Open-Source                              | GPU needed, more effort\nHosted  | Use the AIs hosted on socaity servers or of another provider.  | Runs everywhere, Ultra-easy, always up to date | Slightly higher cost\nHybrid | Deploy on runpod, locally and use socaity services.            | Full flexibility                               | Effort\n\n\n### Example: deploying and using an service locally \n\nThis example demonstrates the use case with [face2face](https://github.com/SocAIty/face2face).\nWith face2face you can swap faces, restore images and detect faces in images.\n```bash\n# Install the package\npip install face2face\n# Start the server on localhost \npython -m face2face.server\n```\nNow you can use the SDK with the service parameter set to \"localhost\"\n```python\nfrom socaity import Face2Face\nf2f = Face2Face(service=\"localhost\")\nf2f.swap_img_to_img(\"path/to/image1.jpg\", \"path/to/image2.jpg\")\n```\n\nSocaity publishes services open-source. So you can use any of them in a similar way.\n\nFurthermore: any service that is created with [FastTaskAPI](https://github.com/SocAIty/FastTaskAPI) can be easily used in combination with [FastSDK](https://github.com/SocaIty/fastsdk).\nCheckout the [FastSDK](https://github.com/SocaIty/fastsdk) documentation for more information.\n\n### Example: using a service hosted on runpod\n\nWe assume the service is already hosted. FastTaskAPI makes it incredibly easy to deploy services.\nCheckout the [FastTaskAPI](https://github.com/SocAIty/FastTaskAPI) documentation to learn how to host on runpod.\n```python\n# setup adresses\nfrom socaity.api.image.img2img.face2face.face2face_service_client import srvc_face2face\nsrvc_face2face.add_service_url(\"my_runpod\", \"https://api.runpod.ai/v2/your_runpod_service_id\")\n# use the service\nf2f = Face2Face(service=\"my_runpod\", api_key=\"your_api_key\")\nf2f.swap_img_to_img(\"path/to/image1.jpg\", \"path/to/image2.jpg\")\n```\n\n\n# Important Note\nPACKAGE IS IN ALPHA RELEASE. \nEXPECT RAPID CHANGES TO SYNTAX AND FUNCTIONALITY.\n\n# Contribute\n\nAny help with maintaining and extending the package is welcome. \nFeel free to open an issue or a pull request.\n\n## PLEASE LEAVE A :star: TO SUPPORT THIS WORK\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocaity%2Fsocaity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocaity%2Fsocaity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocaity%2Fsocaity/lists"}