Skip to content

feat: add BUB_USE_RESPONSES flag#67

Open
anvztor wants to merge 3 commits intoPsiACE:mainfrom
anvztor:feature/use-responses
Open

feat: add BUB_USE_RESPONSES flag#67
anvztor wants to merge 3 commits intoPsiACE:mainfrom
anvztor:feature/use-responses

Conversation

@anvztor
Copy link

@anvztor anvztor commented Feb 25, 2026

Feature Description

Expose a BUB_USE_RESPONSES flag so Bub can opt into Republic/any-llm Responses API routing when upstream gateways only implement /v1/responses.

Investigation

Republic/any-llm defaults to chat completions (/v1/chat/completions). Some OpenAI-compatible gateways only support Responses, which leads to 404s when Bub is configured with those endpoints.

Resolution

  • Add BUB_USE_RESPONSES to settings and pass through to Republic LLM.
  • Document the flag in env.example.

Dependency

Verification

  • uv --directory vendor/bub run bub --help
  • Local mock Responses API test (Bub runtime returns ok when BUB_USE_RESPONSES=true).

Closes #66

@anvztor anvztor force-pushed the feature/use-responses branch from c9b9b5d to dbbecea Compare February 25, 2026 14:23
@anvztor
Copy link
Author

anvztor commented Feb 25, 2026

Local mock Responses API test

We validated the Responses routing in Bub with a local mock server:

  • Mock: .tasks/BUB-RESPONSES/mock_server.py (simple HTTPServer for /v1/responses and /v1/chat/completions).
  • Command (abridged):
    • PORT=18000 LOG_PATH=.tasks/BUB-RESPONSES/mock_requests_local.log python3 .tasks/BUB-RESPONSES/mock_server.py &
    • PYTHONPATH=... BUB_USE_RESPONSES=true BUB_API_BASE=http://127.0.0.1:$PORT/v1 BUB_MODEL=openai:gpt-4o-mini BUB_API_KEY=dummy uv --directory vendor/bub run python - <<'PY' ... build_runtime ... PY
  • Result: assistant_output: ok and mock log shows POST to /v1/responses with converted input.

Not added as an automated test because it requires a live local server/port and environment variables (fragile for CI). If you prefer an integration test, I can add a lightweight one behind a marker or skip flag.

mock_server.py

@anvztor anvztor reopened this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Responses API mode (opt-in)

1 participant