{"id":27817204,"url":"https://github.com/transformrs/transformrs","last_synced_at":"2025-05-01T14:43:24.975Z","repository":{"id":276186447,"uuid":"925676994","full_name":"transformrs/transformrs","owner":"transformrs","description":"Rust interface for AI APIs such as OpenAI, DeepInfra, and Google","archived":false,"fork":false,"pushed_at":"2025-04-05T08:12:21.000Z","size":113,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T13:48:42.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/transformrs","language":"Rust","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/transformrs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"rikhuijzer"}},"created_at":"2025-02-01T13:19:52.000Z","updated_at":"2025-04-11T23:57:41.000Z","dependencies_parsed_at":"2025-03-16T10:19:04.340Z","dependency_job_id":"a5723474-962f-4ede-a8b0-a572b7bb5832","html_url":"https://github.com/transformrs/transformrs","commit_stats":null,"previous_names":["rikhuijzer/transformrs","transformrs/transformrs"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Ftransformrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Ftransformrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Ftransformrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Ftransformrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transformrs","download_url":"https://codeload.github.com/transformrs/transformrs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251892501,"owners_count":21660983,"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":[],"created_at":"2025-05-01T14:43:24.448Z","updated_at":"2025-05-01T14:43:24.965Z","avatar_url":"https://github.com/transformrs.png","language":"Rust","funding_links":["https://github.com/sponsors/rikhuijzer"],"categories":[],"sub_categories":[],"readme":"# transformrs\n\ntransformrs is an interface for AI API providers.\n\nFor examples, see [`examples/`](https://github.com/transformrs/transformrs/tree/main/examples).\n\nProvider | Chat* | Text to Image | Text to Speech\n--: | --- | --- | ---\nCerebras | x |\nElevenLabs | | | x\nDeepInfra | x | x | x\nGoogle | x |  | [x](#google-cloud-api)\nGroq | x |\nHyperbolic | x | x | x\nOpenAI | x | | [x](https://platform.openai.com/docs/guides/text-to-speech)\nOther** | x\nSambaNova | x |\nTogetherAI | x |\n\n\n\\*Chat supports streaming and image input.\n\n\\*\\*Other OpenAI-compatible providers can be used via `Provider::Other(base_url)`.\n\n## Users \n\nProjects that use this library:\n\n- [trf](https://github.com/transformrs/trf) - A command line tool to interact with AI providers.\n- [trv](https://github.com/transformrs/trv) - A command line tool to create videos from slides and text.\n\n## Why was this Project Created?\n\nI was looking into making a command line tool that could summarize PDF files.\nThen I noticed that I probably needed to use a cloud provider.\nHowever, then I would be requiring myself and users to use the same cloud provider.\nThis library is avoids that.\nIt provides the interface to multiple cloud providers, so that users can pick their favourite.\n\n## Cloud versus Local\n\nI think running AI locally is a nice idea that is unlikely to take off.\nMost people will want to use the best AI models that are available.\nHowever, this is unreasonably expensive and slow.\nIn most cases, running AI in the cloud will be orders of magnitude cheaper and faster.\nFor example, running DeepSeek R1 requires a $2000 server while the server still only does around 2-3 tokens per second.\nThis means that responses will take multiple minutes to complete.\nConversely, running the same model in the cloud will cost only a few cents per million tokens and is much faster.\nAssuming you would use about 10 000 tokens per day, the cost would still only be around $4 per year.\nPrices are also falling with around [80% per year](https://huijzer.xyz/posts/ai-learning-rate/).\nSo if you take into account the cost of the server and the cost of having to wait for the response, the cloud is several orders of magnitude cheaper.\n\nThat's why I expect that most people will run AI in the cloud.\nLuckily, there are nowadays many providers.\nThis library aims to make it easy to easily built on top of these providers.\n\n## Rust\n\nSince we're building on top of HTTP via cloud providers, we do not necessarily need Python for running AI.\nWe can use Rust which in my opinion is better suited for this task.\nRust code usually has fewer bugs, produces smaller binaries, is easier to distribute, has better WebAssembly support, and is faster.\n\n## Core Utilities\n\nWhat I hope is that we will see many more \"core utilities\" like `cat`, `ls`, and `grep` built on top of AI.\nAs pointed out above, it is unlikely that these utilities will run the models locally.\nInstead, it's more likely that they will be built on top of the cloud providers.\nOne example of this is [llm](https://github.com/simonw/llm) by Simon Willison.\nExamples I'd looking forward to are PDF summarizers, PDF to text, text to speech, and more.\n\n## Why the name transformrs?\n\nEssentially AI is about transforming data, so I called this library `transformrs` as \"Transformations in Rust\".\nIt's also a play on the word \"transformers\" which is an important algorithm in AI.\n\n## Google Cloud API\n\nThis is a difficult one to get the key working.\nOn the Cloud Text-to-Speech API page, click to enable the API.\nIn the API key page (API \u0026 Services -\u003e Credentials), ensure that the key has access (is restricted to) the Cloud Text-to-Speech API (for text to speech) and the Generative Language API (for chat completions).\n\nThis is using the \"old\" Cloud Text-to-Speech API instead of the \"new\" Gemini 2.0 API.\nGemini 2.0 can do higher quality text to speech, but it currently seems not very stable yet.\nIt for example doesn't follow the prompt very closely.\nIt may for example say \"This is the text you asked for\" instead of just reading the text.\n\nThe API is documented at [cloud.google.com](https://cloud.google.com/text-to-speech/docs/reference/rest/v1beta1/text/synthesize).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransformrs%2Ftransformrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransformrs%2Ftransformrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransformrs%2Ftransformrs/lists"}