├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .prettierrc ├── .vscode └── settings.json ├── CLAUDE.md ├── LICENSE ├── README.md ├── bun.lock ├── examples ├── README.md ├── basic-translation.ts ├── chatbot-service.ts ├── cost-optimizer.ts ├── function-calling.ts ├── image-analysis.ts ├── load-balancer.ts └── universal-middleware.ts ├── package.json ├── pnpm-lock.yaml ├── renovate.json ├── src ├── errors │ ├── constants.ts │ ├── index.ts │ ├── parser.ts │ ├── types.ts │ ├── universal.ts │ └── utils.ts ├── handler.ts ├── helpers │ ├── index.ts │ ├── reconstructing.ts │ ├── type-guards.ts │ └── utils.ts ├── index.ts ├── models │ ├── anthropic-format │ │ └── index.ts │ ├── detector.ts │ ├── google-format │ │ └── index.ts │ ├── helpers.ts │ ├── index.ts │ ├── openai-format │ │ └── index.ts │ └── translate.ts ├── tools │ ├── continuation.ts │ ├── extractor.ts │ └── index.ts └── types │ ├── index.ts │ ├── observability.ts │ ├── providers.ts │ └── universal.ts ├── test ├── anthropic-tool-calls.test.ts ├── anthropic-tool-use-validation.test.ts ├── bug-reproduction.test.ts ├── error-handling.test.ts ├── errors-index.test.ts ├── google-original-raw-validation.test.ts ├── google-tool-calls.test.ts ├── google-tools-bug-fix.test.ts ├── handler-malformed-input.test.ts ├── handler.test.ts ├── helpers.test.ts ├── index.test.ts ├── message-injection.test.ts ├── models-helpers.test.ts ├── openai-tool-calls.test.ts ├── provider-detection.test.ts ├── provider-formats.test.ts ├── provider-validation.test.ts ├── remaining-error-coverage.test.ts ├── tool-result-handling.test.ts └── universal-conversion.test.ts ├── tsconfig.json ├── tsup.config.ts └── vitest.config.mjs /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | *.log 5 | coverage -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | "@egoist/prettier-config" 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true 3 | } 4 | -------------------------------------------------------------------------------- /CLAUDE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/CLAUDE.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/README.md -------------------------------------------------------------------------------- /bun.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/bun.lock -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/README.md -------------------------------------------------------------------------------- /examples/basic-translation.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/basic-translation.ts -------------------------------------------------------------------------------- /examples/chatbot-service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/chatbot-service.ts -------------------------------------------------------------------------------- /examples/cost-optimizer.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/cost-optimizer.ts -------------------------------------------------------------------------------- /examples/function-calling.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/function-calling.ts -------------------------------------------------------------------------------- /examples/image-analysis.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/image-analysis.ts -------------------------------------------------------------------------------- /examples/load-balancer.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/load-balancer.ts -------------------------------------------------------------------------------- /examples/universal-middleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/examples/universal-middleware.ts -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/package.json -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/pnpm-lock.yaml -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:base"] 3 | } 4 | -------------------------------------------------------------------------------- /src/errors/constants.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/errors/constants.ts -------------------------------------------------------------------------------- /src/errors/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/errors/index.ts -------------------------------------------------------------------------------- /src/errors/parser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/errors/parser.ts -------------------------------------------------------------------------------- /src/errors/types.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/errors/types.ts -------------------------------------------------------------------------------- /src/errors/universal.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/errors/universal.ts -------------------------------------------------------------------------------- /src/errors/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/errors/utils.ts -------------------------------------------------------------------------------- /src/handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/handler.ts -------------------------------------------------------------------------------- /src/helpers/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/helpers/index.ts -------------------------------------------------------------------------------- /src/helpers/reconstructing.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/helpers/reconstructing.ts -------------------------------------------------------------------------------- /src/helpers/type-guards.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/helpers/type-guards.ts -------------------------------------------------------------------------------- /src/helpers/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/helpers/utils.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/models/anthropic-format/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/models/anthropic-format/index.ts -------------------------------------------------------------------------------- /src/models/detector.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/models/detector.ts -------------------------------------------------------------------------------- /src/models/google-format/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/models/google-format/index.ts -------------------------------------------------------------------------------- /src/models/helpers.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/models/helpers.ts -------------------------------------------------------------------------------- /src/models/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/models/index.ts -------------------------------------------------------------------------------- /src/models/openai-format/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/models/openai-format/index.ts -------------------------------------------------------------------------------- /src/models/translate.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/models/translate.ts -------------------------------------------------------------------------------- /src/tools/continuation.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/tools/continuation.ts -------------------------------------------------------------------------------- /src/tools/extractor.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/tools/extractor.ts -------------------------------------------------------------------------------- /src/tools/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/tools/index.ts -------------------------------------------------------------------------------- /src/types/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/types/index.ts -------------------------------------------------------------------------------- /src/types/observability.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/types/observability.ts -------------------------------------------------------------------------------- /src/types/providers.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/types/providers.ts -------------------------------------------------------------------------------- /src/types/universal.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/src/types/universal.ts -------------------------------------------------------------------------------- /test/anthropic-tool-calls.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/anthropic-tool-calls.test.ts -------------------------------------------------------------------------------- /test/anthropic-tool-use-validation.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/anthropic-tool-use-validation.test.ts -------------------------------------------------------------------------------- /test/bug-reproduction.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/bug-reproduction.test.ts -------------------------------------------------------------------------------- /test/error-handling.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/error-handling.test.ts -------------------------------------------------------------------------------- /test/errors-index.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/errors-index.test.ts -------------------------------------------------------------------------------- /test/google-original-raw-validation.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/google-original-raw-validation.test.ts -------------------------------------------------------------------------------- /test/google-tool-calls.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/google-tool-calls.test.ts -------------------------------------------------------------------------------- /test/google-tools-bug-fix.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/google-tools-bug-fix.test.ts -------------------------------------------------------------------------------- /test/handler-malformed-input.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/handler-malformed-input.test.ts -------------------------------------------------------------------------------- /test/handler.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/handler.test.ts -------------------------------------------------------------------------------- /test/helpers.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/helpers.test.ts -------------------------------------------------------------------------------- /test/index.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/index.test.ts -------------------------------------------------------------------------------- /test/message-injection.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/message-injection.test.ts -------------------------------------------------------------------------------- /test/models-helpers.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/models-helpers.test.ts -------------------------------------------------------------------------------- /test/openai-tool-calls.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/openai-tool-calls.test.ts -------------------------------------------------------------------------------- /test/provider-detection.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/provider-detection.test.ts -------------------------------------------------------------------------------- /test/provider-formats.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/provider-formats.test.ts -------------------------------------------------------------------------------- /test/provider-validation.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/provider-validation.test.ts -------------------------------------------------------------------------------- /test/remaining-error-coverage.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/remaining-error-coverage.test.ts -------------------------------------------------------------------------------- /test/tool-result-handling.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/tool-result-handling.test.ts -------------------------------------------------------------------------------- /test/universal-conversion.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/test/universal-conversion.test.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/tsconfig.json -------------------------------------------------------------------------------- /tsup.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/tsup.config.ts -------------------------------------------------------------------------------- /vitest.config.mjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supermemoryai/llm-bridge/HEAD/vitest.config.mjs --------------------------------------------------------------------------------