tool-bridge / README.md
Looknicemm's picture
Deploy tool-bridge: Dockerfile, app, README
5378442 verified
|
Raw
History Blame Contribute Delete
1.57 kB
metadata
title: Tool Bridge
emoji: πŸ”§
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 8080
pinned: false
short_description: OpenAI/Anthropic tool-calling bridge for non-tool upstreams

newapi-tool-bridge

OpenAI / Anthropic compatible tool-calling bridge proxy.

Wraps an upstream API that lacks native tool calling (e.g. a ChatGPT reverse-proxy) into an OpenAI-compatible endpoint that supports tools / tool_choice / parallel_tool_calls, plus full Anthropic Messages API (/v1/messages) translation.

Endpoints

  • GET /v1/models β€” list models
  • POST /v1/chat/completions β€” OpenAI Chat Completions
  • POST /v1/messages β€” Anthropic Messages API
  • GET /health β€” health check
  • other paths β€” proxied to upstream

Auth (this deployment)

Public Space, bring-your-own-key: UPSTREAM_AUTH_HEADER is unset, so the upstream key you send in Authorization: Bearer <key> (or x-api-key) is passed through to the upstream. No key is baked into this Space.

Config (Space variables)

var meaning
UPSTREAM_BASE_URL upstream root (no /v1)
MODEL_MAP_JSON external model name β†’ upstream model name
PUBLIC_MODEL_IDS_JSON model ids returned by /v1/models
NATIVE_TOOL_MODELS_JSON models with native tool calling (passthrough)
ALLOW_UNMAPPED_MODEL_PASSTHROUGH pass unmapped model names through

Virtual tool calling: for upstreams without native tools, the tool defs are injected into the system prompt, the model's JSON output is parsed back into standard tool_calls.