Skip to content

cli: talk to any TypeSafe-compatible server (e.g. Open-Jev) and run local models #36

Description

@dfa1

Today cli always builds DefaultTypeSafeClient.builder().apiKey(ApiKey.fromDefaultFile()) against api.typesafe.ai: no other endpoint, the key file is required, and nothing local.

Proposal

Any TypeSafe-compatible HTTP server

  • --endpoint <url> → Builder.endpoint(URI), e.g. a server running Open-Jev or the MLX Clef-flash server from the how-to (http://localhost:8000/v1/systemone).
  • The API key becomes optional when --endpoint is given: no ~/.typesafe.apikey means no Authorization header (the builder already supports that).

Local models (client-local)

  • e.g. --local laya <dir> / --local qwen <dir> / --local clef <dir> → LocalLayaTypeSafeClient.load(dir) etc.; the rest of the CLI (questions, --print, --verbose, --timing) is unchanged, since all of them are TypeSafeClients.

Open questions

  • Jar size: client-local brings ONNX Runtime (~56 MB, native libraries for every platform) into the all uber-jar. Options: a separate classifier (e.g. all-local), or load client-local only if it's on the classpath.
  • Flag shape: --local <engine> <dir>, or --engine laya --model-dir <dir>?
  • Model id: --model is meaningless locally (the local clients accept only jev-latest/jev-preview/their own id); reject it there, or ignore it?

Depends on the module split (#35) landing first.

🤖 Generated with Claude Code

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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