Skip to content

[Bug]: Can't add embeddings from LMStudio #482

@rom100main

Description

@rom100main

Describe the bug

When adding an embeddings Smart Composer create a request like this OPTIONS /v1/embeddings.
But LMStudio only accept request like this POST /v1/embeddings.

Steps to reproduce

  1. Go to Smart Composer settings
  2. Go to category "Embedding Models"
  3. Click on "Add custom model"
  4. Fill the info for your embedding
  5. Click on "Add"

Operating System

macOS

Obsidian Version

1.9.14

Obsidian Installer Version

1.6.3

Smart Composer Version

1.2.4

Screenshots

No response

Error logs

Access to fetch at 'http://127.0.0.1:1234/v1/embeddings' from origin 'app://obsidian.md' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
plugin:smart-composer:80 
        
        
       POST http://127.0.0.1:1234/v1/embeddings net::ERR_FAILED
fetchWithTimeout @ plugin:smart-composer:80
makeRequest @ plugin:smart-composer:80
await in makeRequest (async)
request @ plugin:smart-composer:80
methodRequest @ plugin:smart-composer:80
post @ plugin:smart-composer:80
create @ plugin:smart-composer:85
getEmbedding @ plugin:smart-composer:101
a @ plugin:smart-composer:728
eval @ plugin:smart-composer:250
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
y @ app.js:1
(anonymous) @ app.js:1
index.html:1 Access to fetch at 'http://127.0.0.1:1234/v1/embeddings' from origin 'app://obsidian.md' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
plugin:smart-composer:80 
        
        
       POST http://127.0.0.1:1234/v1/embeddings net::ERR_FAILED
fetchWithTimeout @ plugin:smart-composer:80
makeRequest @ plugin:smart-composer:80
await in makeRequest (async)
retryRequest @ plugin:smart-composer:80
await in retryRequest (async)
makeRequest @ plugin:smart-composer:80
await in makeRequest (async)
request @ plugin:smart-composer:80
methodRequest @ plugin:smart-composer:80
post @ plugin:smart-composer:80
create @ plugin:smart-composer:85
getEmbedding @ plugin:smart-composer:101
a @ plugin:smart-composer:728
eval @ plugin:smart-composer:250
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
y @ app.js:1
(anonymous) @ app.js:1
index.html:1 Access to fetch at 'http://127.0.0.1:1234/v1/embeddings' from origin 'app://obsidian.md' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
plugin:smart-composer:80 
        
        
       POST http://127.0.0.1:1234/v1/embeddings net::ERR_FAILED

Additional context

As you can see in the log it seems there is also a problem with CORS.
I try again with CORS disabled but same log (without CORS).

Here is log from LMStudio :

2025-10-03 22:29:41 [DEBUG]
 Received request: OPTIONS to /v1/embeddings
2025-10-03 22:29:41 [ERROR]
 Unexpected endpoint or method. (OPTIONS /v1/embeddings). Returning 200 anyway
2025-10-03 22:29:41 [DEBUG]
 Received request: OPTIONS to /v1/embeddings
2025-10-03 22:29:41 [ERROR]
 Unexpected endpoint or method. (OPTIONS /v1/embeddings). Returning 200 anyway
2025-10-03 22:29:42 [DEBUG]
 Received request: OPTIONS to /v1/embeddings
2025-10-03 22:29:42 [ERROR]
 Unexpected endpoint or method. (OPTIONS /v1/embeddings). Returning 200 anyway

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions