MistralConfig

org.llm4s.llmconnect.config.MistralConfig
See theMistralConfig companion class
@Experimental
object MistralConfig

Attributes

Companion
class
Source
MistralConfig.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def apiBaseUrl(baseUrl: BaseUrl): BaseUrl

The versioned API base the chat client posts /chat/completions under: the configured root plus /v1, as the model lister's /v1/models is.

The versioned API base the chat client posts /chat/completions under: the configured root plus /v1, as the model lister's /v1/models is.

A base URL that already ends in /v1 is used as it is, so the https://api.mistral.ai/v1 that Mistral's own OpenAI-SDK examples use works too. The old client appended /v1 unconditionally and so posted to /v1/v1/chat/completions for such a URL.

Attributes

Source
MistralConfig.scala
def apply(apiKey: Secret, model: ModelName, baseUrl: BaseUrl, contextWindow: Int, reserveCompletion: Int, timeouts: ProviderTimeouts): MistralConfig

Builds a config without validating it; fromValues validates and resolves the context window from the model. Every field after model has a default.

Builds a config without validating it; fromValues validates and resolves the context window from the model. Every field after model has a default.

Attributes

Source
MistralConfig.scala
def apply(apiKey: Secret, model: ModelName): MistralConfig

The API key and model, every other field at its default: the entry point for Java and Kotlin, which do not see Scala default arguments. Set the rest with the with* setters.

The API key and model, every other field at its default: the entry point for Java and Kotlin, which do not see Scala default arguments. Set the rest with the with* setters.

Attributes

Source
MistralConfig.scala
def fromValues(modelName: ModelName, apiKey: Secret, baseUrl: BaseUrl)(using resolver: ContextWindowResolver): Result[MistralConfig]

Constructs a MistralConfig, resolving contextWindow and reserveCompletion from the model name automatically.

Constructs a MistralConfig, resolving contextWindow and reserveCompletion from the model name automatically.

Value parameters

apiKey

Mistral API key; must be non-empty.

baseUrl

API root; must be non-empty. MistralConfig.DEFAULT_BASE_URL is Mistral's own, and the default when loaded via org.llm4s.config.Llm4sConfig.

modelName

Model identifier, e.g. "mistral-large-latest".

Attributes

Returns

Left(ConfigurationError) for a blank apiKey or baseUrl.

Source
MistralConfig.scala

Concrete fields

The context window apply uses when none is given; fromValues resolves the model's own.

The context window apply uses when none is given; fromValues resolves the model's own.

Attributes

Source
MistralConfig.scala

The completion reserve apply uses when none is given; fromValues resolves the model's own.

The completion reserve apply uses when none is given; fromValues resolves the model's own.

Attributes

Source
MistralConfig.scala