Class YiClient

All Implemented Interfaces:
com.tnsai.llm.LLMClient

public class YiClient extends AbstractOpenAICompatibleClient
01.AI Yi LLM client.

01.AI (founded by Kai-Fu Lee) hosts the Yi family of open and proprietary models. Its API is OpenAI-compatible — the same chat-completions wire format as GroqClient / XAIGrokClient / NvidiaNIMClient. The cloud endpoint defaults to https://api.lingyiwanwu.com/v1.

Supported models (at time of writing):

  • yi-large — flagship Yi-Large, frontier tier
  • yi-large-turbo — faster / cheaper Yi-Large variant
  • yi-lightning — small-batch / low-latency Yi-Lightning
  • yi-vision — multimodal Yi-Vision (image input)

The catalog evolves; check the live list at platform.lingyiwanwu.com/docs/api-reference.

Configuration via environment variable:

  • YI_API_KEY — Required for the cloud endpoint.
See Also:
  • Constructor Details

    • YiClient

      public YiClient(String model)
    • YiClient

      public YiClient(String model, float temperature)
    • YiClient

      public YiClient(String model, float temperature, Integer maxTokens)
    • YiClient

      public YiClient(String model, float temperature, Float topP, Integer maxTokens)
    • YiClient

      public YiClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey)
    • YiClient

      public YiClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey)