lmstudio-ai / lmstudio-ai/lmstudio-bug-tracker
Spring Ai and Spring OpenAi do not work using LLM Studio server when creating a MCP client api.
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 152
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
**Which version of LM Studio?**
LM Studio 0.3.6
**Which operating system?**
Win 10
**What is the bug?**
Spring Ai and Spring OpenAi do not work in LLM Studio.
I have configured it using LLM Studio local server and it simply does not respond to the post call executed by Spring OpenAi.
My intention is to create an MCP client using LLM Studio to serve the model locally.
The same configuration using Ollama works without any issues.
**To Reproduce**
- Create a spring boot project using the spring OpenAi dependency and spring web starter
- Configure the application.properties by pointing to the local LLM Studio server:
´´´
spring.ai.openai.chat.base-url=http://127.0.0.1:1234
spring.ai.openai.api-key=lm-studio
spring.ai.openai.chat.options.model=mistral-nemo-instruct-2407
´´´
- Create a controller for testing:
´´´ java
package com.matdev.mcp_cli;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api")
public class TestController {
private final ChatClient chatClient;
// Injeta o ChatClient configurado automaticamente pelo Spring AI
// usando as propriedades definidas em application.properties
@Autowired
public TestController(ChatClient.Builder chatClientBuilder) {
// O Builder aplica a configuração global (base-url, api-key, options.model)
this.chatClient = chatClientBuilder.build();
}
@GetMapping("/ai/test")
public String testLmStudioConnection(
@RequestParam(value = "prompt", defaultValue = "Responda com 'Pong'") String prompt) {
try {
String response = chatClient.prompt()
.user(prompt)
.call()
.content(); // Obtém o conteúdo da resposta como String
return "LLM Response: " + response;
} catch (Exception e) {
return "Error connecting to LLM: " + e.getMessage();
}
}
@GetMapping("test")
public String testApiOnline(){
return "api Online!";
}
}
´´´
- run this springboot aplication and in insomnia or postman exec a get req for localhost:8080/api/ai/test
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied application.properties configuration and TestController, then reproduce the GET /api/ai/test request against LM Studio 0.3.6 on Windows 10. Compare the request response with the working Ollama setup; done means the cause of the non-response is identified and the supported configuration or limitation is recorded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100