Skip to content

Unable to set custom embeddings model.  #1

@afewell

Description

@afewell

I have tried adding an application.properties file with spring.ai.openai.embedding.options.model=phi3, tried setting it in yaml format in the application.yml file, I also tried updating SpringApplicationContextInitializer with:

if (!llmServices.isEmpty()) {
            logger.info("Setting service profile llm");
            appEnvironment.addActiveProfile("llm");
            CfCredentials llmCredentials = cfEnv.findCredentialsByTag("llm");
            appEnvironment.getSystemProperties().put("spring.ai.openai.base-url", llmCredentials.getMap().get("api_base") + "/");
            appEnvironment.getSystemProperties().put("spring.ai.openai.api-key", llmCredentials.getMap().get("api_key"));
            appEnvironment.getSystemProperties().put("spring.ai.openai.chat.options.model", "phi3");
            appEnvironment.getSystemProperties().put("spring.ai.openai.embedding.options.model", "phi3");

And for each of these options when I try to deploy it crashes with error:

[APP/PROC/WEB/0] OUT com.theokanning.openai.OpenAiHttpException: {"error": "embeddings: Invalid model name passed in model=text-embedding-ada-002"}

Do you know what I can do to properly specify the embeddings model?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions