Skip to content

Document and expose model.openai.base-url in application.yml and README #27

Description

@devops-thiago

Background

ModelConfig.OpenAISettings defines a baseUrl field, and OpenAIModelProvider (src/main/java/br/com/arquivolivre/myjavagenie/service/OpenAIModelProvider.java, ~line 57) already applies it (builder.baseUrl(...)). However, src/main/resources/application.yml does not define model.openai.base-url, so the only way to use a custom OpenAI-compatible endpoint with the OpenAI provider is the undocumented MODEL_OPENAI_BASE_URL env var via Spring relaxed binding.

Impact

  • Users of OpenAI-compatible proxies/gateways (LM Studio, vLLM, OpenRouter, Ollama Cloud, etc.) cannot discover how to configure a custom base URL for the OpenAI provider.
  • The config surface is incomplete relative to the code's capabilities.
  • The self-hosted provider documents base-url in YAML, but the OpenAI provider does not.

How to reproduce

  1. Set model.provider: openai and point the app at an OpenAI-compatible endpoint.
  2. Search application.yml and the README for base-url under the openai section — nothing documents it.

Where the fix should land

Add the missing property to src/main/resources/application.yml:

model:
  openai:
    api-key: ${OPENAI_API_KEY:}
    base-url: ${OPENAI_BASE_URL:}
    model-name: gpt-4
    timeout-seconds: 300

Document the variable in the README configuration section.

Files touched

  • src/main/resources/application.yml
  • README.md
  • Optionally src/test/java/.../OpenAIModelProviderTest.java asserting the custom base URL is applied to the builder.

Acceptance criteria

  • model.openai.base-url (and the OPENAI_BASE_URL env var) is documented in YAML and README.
  • With model.provider: openai and a custom base-url, requests are sent to that endpoint (verifiable via a WireMock test).
  • Default behavior (no base-url set) is unchanged — falls back to the OpenAI default endpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavaPull requests that update java code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions