block / block/berd

Berd's LM Studio provider is double-appending /v1 when the configured Base URL already includes it

Open
#144 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
909
Forks
116
Avg merge
1d 1h
Merged PRs (30d)
156

Description

### Before filing

- [x] I searched [open and closed issues](https://github.com/block/berd/issues?q=is%3Aissue) for duplicates.
- [x] I reproduced this on the [latest release](https://github.com/block/berd/releases).
- [x] This is one bug, not several bundled together.

### Closest existing issue

none found

### What's broken

Berd's LM Studio provider is double-appending /v1 when the configured Base URL already includes it, producing malformed requests (/v1/v1/models, /v1/v1/chat/completions).

Symptom: chat/model-list requests land as /v1/v1/... on the LM Studio side (confirmed via LM Studio's own server log), and the resulting failure shows in Berd only as "Unknown"

### Steps to reproduce

1. Start LM Studio's local server (Local Server tab → Start), with a model loaded.
2. In Berd, add/configure a custom OpenAI-compatible provider pointing at LM Studio, setting Base URL to http://localhost:1234/v1 (i.e., including the /v1 suffix, as commonly documented for OpenAI-compatible endpoints).
3. Save the provider. Connection check succeeds — Berd fetches the model list fine.
4. Start a chat session using that provider/model and send any message (e.g. "hello").

### What you expected to happen

Message sends normally and the model responds.

### What actually happened

Chat fails immediately with a "The model returned an empty response. Please resend your message to continue."
Also the connection throws a warning as unknown error.

### How often does it happen?

Every time — reliably reproducible

### Berd version

0.6.2

### Operating system

macOS (Apple Silicon)

### Model and provider

LM Studio Bionic

### Relevant log output

```text
It's from lm studio NOT Berd.

183 [2026-08-20 12:40:17][DEBUG] Received request: GET to /v1/v1/models
184 [2026-08-20 12:40:17][ERROR] Unexpected endpoint or method. (GET /v1/v1/models). Returning 200 anyway
185 [2026-08-20 12:40:17][DEBUG] Received request: GET to /v1/v1/models
186 [2026-08-20 12:40:17][ERROR] Unexpected endpoint or method. (GET /v1/v1/models). Returning 200 anyway
```

### Screenshots, recordings, or other context

_No response_

Contributor guide

Open the contributing guide

Research direction

Trace the LM Studio or custom OpenAI-compatible provider entry point where the configured Base URL is combined with model-list and chat paths. Reproduce with a URL ending in /v1 and inspect the generated requests. Done means URLs ending in /v1 no longer become /v1/v1/models or /v1/v1/chat/completions, while normal chat and model loading still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.