org.llm4s.doctor

Members list

Type members

Classlikes

@Experimental

How one step of the setup check ended. Skipped means it was not run, and is neither good nor bad.

How one step of the setup check ended. Skipped means it was not run, and is neither good nor bad.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
@Experimental
object Doctor

Checks a whole LLM4S setup in one run and says what to change when a step fails.

Checks a whole LLM4S setup in one run and says what to change when a step fails.

The steps, in order: the JDK, the configuration, the default provider, its module on the classpath, its API key, its config, a local model server (only with DoctorOptions.local), one small request (only with DoctorOptions.live), and the configuration's other provider sections. A step that cannot run because an earlier one failed is reported as skipped, not as failed.

By default nothing leaves the machine and no server is contacted, not even a local one: the network is used only when a run asks for it. The configuration is read through Llm4sConfig, so its sections, the default and the shared llm4s.credentials mean exactly what they mean to an application. The API key's value is never put in the report: only the config path it came from is shown, and every key, header value and base-URL credential the configuration holds is hidden by value in every message as well. A URL is printed without its user info, query or fragment.

From code, run checks the configuration the application itself loads (application.conf on its classpath, -D overrides and every module's reference.conf) against the provider modules on its classpath; log the DoctorReport at startup, or fail a test on its DoctorReport.exitCode. From a shell, DoctorCli.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Doctor.type
@Experimental
final case class DoctorCheck

One step of the setup check.

One step of the setup check.

Every string is passed through org.llm4s.util.Redaction when the check is built, so a message that quotes a configuration error cannot carry a credential into the report. The doctor never puts an API key's value in a message, and Doctor.run also hides every key the configuration holds by value; this shape-based pass is the last line of defence, not the first.

Value parameters

detail

what was found

fix

what to change when the step did not pass

name

what was checked, e.g. Provider config

status

how it ended

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object DoctorCheck

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
@Stable
object DoctorCli

llm4s doctor as a command line. Run it on the application's own classpath, so it checks the provider modules the application depends on and the application.conf it loads: from sbt, sbt "Test/runMain org.llm4s.doctor.DoctorCli" with llm4s-doctor as a test dependency; without a project, cs launch org.llm4s:llm4s-doctor_3:<version> org.llm4s:llm4s-<provider>_3:<version> -- --config application.conf. See docs/reference/doctor.md.

llm4s doctor as a command line. Run it on the application's own classpath, so it checks the provider modules the application depends on and the application.conf it loads: from sbt, sbt "Test/runMain org.llm4s.doctor.DoctorCli" with llm4s-doctor as a test dependency; without a project, cs launch org.llm4s:llm4s-doctor_3:<version> org.llm4s:llm4s-<provider>_3:<version> -- --config application.conf. See docs/reference/doctor.md.

Options: --config <file> to check a file layered over every module's reference.conf instead of the application's own configuration, --classpath <path> to check the provider modules, reference.conf files and (without --config) application.conf on an application's classpath instead of the doctor's own, --local to ask a model server on this machine which models it has, --live to make one small request, --timeout <seconds> for that request, and --json. Without --local or --live nothing is contacted. Exit code: 0 everything passed, 1 warnings only, 2 something failed.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
DoctorCli.type
@Experimental
final case class DoctorOptions

What a doctor run may do. By default it contacts nothing.

What a doctor run may do. By default it contacts nothing.

Value parameters

applicationClasspath

the registry was discovered on the application's classpath (--classpath), not the doctor's own, which has every built-in provider module

live

make one small request to the configured provider (billed for a hosted one)

liveTimeout

how long to wait for the live request before reporting it as failed

local

ask a model server on the loopback interface which models it has

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object DoctorOptions

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
@Experimental
final case class DoctorReport

The outcome of a doctor run.

The outcome of a doctor run.

Value parameters

checks

the steps in the order they were checked

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object DoctorReport

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type