{"id":25412815,"url":"https://github.com/lunary-ai/abso","last_synced_at":"2025-10-31T06:31:23.744Z","repository":{"id":276473226,"uuid":"929384099","full_name":"lunary-ai/abso","owner":"lunary-ai","description":"TypeScript SDK to call 100+ LLM Providers in OpenAI format.","archived":false,"fork":false,"pushed_at":"2025-02-15T16:49:30.000Z","size":151,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T16:56:10.216Z","etag":null,"topics":["ai","anthropic","azure-openai","bedrock","gemini","grok","groq","groq-ai","llm","mistral","ollama","openai","openrouter","voyage","xai"],"latest_commit_sha":null,"homepage":"https://abso.ai","language":"TypeScript","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/lunary-ai.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":"2025-02-08T12:27:17.000Z","updated_at":"2025-02-15T16:49:34.000Z","dependencies_parsed_at":"2025-02-09T20:45:09.767Z","dependency_job_id":null,"html_url":"https://github.com/lunary-ai/abso","commit_stats":null,"previous_names":["lunary-ai/abso"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunary-ai%2Fabso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunary-ai%2Fabso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunary-ai%2Fabso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunary-ai%2Fabso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunary-ai","download_url":"https://codeload.github.com/lunary-ai/abso/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239133023,"owners_count":19587180,"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":["ai","anthropic","azure-openai","bedrock","gemini","grok","groq","groq-ai","llm","mistral","ollama","openai","openrouter","voyage","xai"],"created_at":"2025-02-16T13:27:59.533Z","updated_at":"2025-10-31T06:31:23.732Z","avatar_url":"https://github.com/lunary-ai.png","language":"TypeScript","funding_links":[],"categories":["Recently Updated","Large Language Models (LLMs)"],"sub_categories":["[Feb 18, 2025](/content/2025/02/18/README.md)","Contribute to our Repository"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/cfec6d10-7e1e-4412-bd4b-edb3df45fe99\" alt=\"Abso banner\" width=1040 /\u003e\n\u003c/p\u003e\n\n**Drop-in replacement for OpenAI**\n\n[![npm version](https://badge.fury.io/js/abso-ai.svg)](https://badge.fury.io/js/abso-ai) ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/lunary-ai/abso) ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/w/lunary-ai/abso)\n\n**Abso** provides a unified interface for calling various LLMs while maintaining full type safety.\n\n\u003c/div\u003e\n\n## Features\n\n- **OpenAI-compatible API 🔁** (drop in replacement)\n- **Call any LLM provider** (OpenAI, Anthropic, Groq, Ollama, etc.)\n- **Lightweight \u0026 Fast ⚡**\n- **Embeddings support 🧮**\n- **Unified tool calling 🛠️**\n- **Tokenizer and cost calculation (soon) 🔢**\n- **Smart routing (soon)**\n\n## Providers\n\n| Provider   | Chat | Streaming | Tool Calling | Embeddings | Tokenizer | Cost Calculation |\n| ---------- | ---- | --------- | ------------ | ---------- | --------- | ---------------- |\n| OpenAI     | ✅   | ✅        | ✅           | ✅         | 🚧        | 🚧               |\n| Anthropic  | ✅   | ✅        | ✅           | ❌         | 🚧        | 🚧               |\n| xAI Grok   | ✅   | ✅        | ✅           | ❌         | 🚧        | 🚧               |\n| Mistral    | ✅   | ✅        | ✅           | ❌         | 🚧        | 🚧               |\n| Groq       | ✅   | ✅        | ✅           | ❌         | ❌        | 🚧               |\n| Ollama     | ✅   | ✅        | ✅           | ❌         | ❌        | 🚧               |\n| OpenRouter | ✅   | ✅        | ✅           | ❌         | ❌        | 🚧               |\n| Voyage     | ❌   | ❌        | ❌           | ✅         | ❌        | ❌               |\n| Azure      | 🚧   | 🚧        | 🚧           | 🚧         | ❌        | 🚧               |\n| Bedrock    | 🚧   | 🚧        | 🚧           | 🚧         | ❌        | 🚧               |\n| Gemini     | ✅   | ✅        | ✅           | ❌         | 🚧        | ❌               |\n| DeepSeek   | ✅   | ✅        | ✅           | ❌         | 🚧        | ❌               |\n| Perplexity | ✅   | ✅        | ❌           | ❌         | 🚧        | ❌               |\n\n## Installation\n\n```bash\nnpm install abso-ai\n```\n\n## Usage\n\n```ts\nimport { abso } from \"abso-ai\"\n\nconst result = await abso.chat.completions.create({\n  messages: [{ role: \"user\", content: \"Say this is a test\" }],\n  model: \"gpt-4o\",\n})\n\nconsole.log(result.choices[0].message.content)\n```\n\n## Manually selecting a provider\n\nAbso tries to infer the correct provider for a given model, but you can also manually select a provider.\n\n```ts\nconst result = await abso.chat.completions.create({\n  messages: [{ role: \"user\", content: \"Say this is a test\" }],\n  model: \"openai/gpt-4o\",\n  provider: \"openrouter\",\n})\n\nconsole.log(result.choices[0].message.content)\n```\n\n## Streaming\n\n```ts\nconst stream = await abso.chat.completions.create({\n  messages: [{ role: \"user\", content: \"Say this is a test\" }],\n  model: \"gpt-4o\",\n  stream: true,\n})\n\nfor await (const chunk of stream) {\n  console.log(chunk)\n}\n\n// Helper to get the final result\nconst fullResult = await stream.finalChatCompletion()\n\nconsole.log(fullResult)\n```\n\n## Embeddings\n\n```ts\nconst embeddings = await abso.embeddings.create({\n  model: \"text-embedding-3-small\",\n  input: [\"A cat was playing with a ball on the floor\"],\n})\n\nconsole.log(embeddings.data[0].embedding)\n```\n\n## Tokenizers (soon)\n\n```ts\nconst tokens = await abso.chat.tokenize({\n  messages: [{ role: \"user\", content: \"Hello, world!\" }],\n  model: \"gpt-4o\",\n})\n\nconsole.log(`${tokens.count} tokens`)\n```\n\n## Custom Providers\n\nYou can also configure built-in providers directly by passing a configuration object with provider names as keys when instantiating Abso:\n\n```ts\nimport { Abso } from \"abso-ai\"\n\nconst abso = new Abso({\n  openai: { apiKey: \"your-openai-key\" },\n  anthropic: { apiKey: \"your-anthropic-key\" },\n  // add other providers as needed\n})\n\nconst result = await abso.chat.completions.create({\n  model: \"gpt-4o\",\n  messages: [{ role: \"user\", content: \"Hello!\" }],\n})\n\nconsole.log(result.choices[0].message.content)\n```\n\nAlternatively, you can also change the providers that are loaded by passing a custom `providers` array to the constructor.\n\n## Observability\n\nYou can use Abso with [Lunary](https://lunary.ai) to get instant observability into your LLM usage.\n\nFirst signup to [Lunary](https://lunary.ai) and get your public key.\n\nThen simply set the `LUNARY_PUBLIC_KEY` environment variable to your public key to enable observability.\n\n## Contributing\n\nSee our [Contributing Guide](CONTRIBUTING.md).\n\n## Roadmap\n\n- [ ] More providers\n- [ ] Built in caching\n- [ ] Tokenizers\n- [ ] Cost calculation\n- [ ] Smart routing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunary-ai%2Fabso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunary-ai%2Fabso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunary-ai%2Fabso/lists"}