Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cmd/cli/readline/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,3 @@ import (
)

var ErrInterrupt = errors.New("Interrupt")

type InterruptError struct {
Line []rune
}

func (*InterruptError) Error() string {
return "Interrupted"
}
4 changes: 0 additions & 4 deletions cmd/cli/readline/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ func (h *History) Compact() {
}
}

func (h *History) Clear() {
h.Buf.Clear()
}

func (h *History) Prev() (line string) {
if h.Pos > 0 {
h.Pos--
Expand Down
4 changes: 0 additions & 4 deletions cmd/cli/readline/readline.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,6 @@ func (i *Instance) Readline() (string, error) {
}
}

func (i *Instance) HistoryEnable() {
i.History.Enabled = true
}

func (i *Instance) HistoryDisable() {
i.History.Enabled = false
}
Expand Down
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/emirpasic/gods/v2 v2.0.0-alpha
github.com/fatih/color v1.19.0
github.com/gpustack/gguf-parser-go v0.24.0
github.com/jaypipes/ghw v0.24.0
github.com/kolesnikovae/go-winjob v1.0.0
github.com/mattn/go-runewidth v0.0.23
github.com/mattn/go-shellwords v1.0.12
Expand Down Expand Up @@ -85,7 +84,6 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect
github.com/henvic/httpretty v0.1.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jaypipes/pcidb v1.1.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.5 // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
Expand Down Expand Up @@ -148,7 +146,6 @@ require (
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
howett.net/plist v1.0.2-0.20250314012144-ee69052608d9 // indirect
)

replace github.com/kolesnikovae/go-winjob => github.com/docker/go-winjob v0.0.0-20250829235554-57b487ebcbc5
7 changes: 0 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUq
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jaypipes/ghw v0.24.0 h1:6RBrJzvHvZ0t+hSvqPmOd5b21C4fMsyiyFzWljEj8Wg=
github.com/jaypipes/ghw v0.24.0/go.mod h1:Qk3UjdH8Xu/OiVyb/eDJqnDsUc+awHU75y23ErZU33s=
github.com/jaypipes/pcidb v1.1.1 h1:QmPhpsbmmnCwZmHeYAATxEaoRuiMAJusKYkUncMC0ro=
github.com/jaypipes/pcidb v1.1.1/go.mod h1:x27LT2krrUgjf875KxQXKB0Ha/YXLdZRVmw6hH0G7g8=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down Expand Up @@ -386,7 +381,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
howett.net/plist v1.0.2-0.20250314012144-ee69052608d9 h1:eeH1AIcPvSc0Z25ThsYF+Xoqbn0CI/YnXVYoTLFdGQw=
howett.net/plist v1.0.2-0.20250314012144-ee69052608d9/go.mod h1:fyFX5Hj5tP1Mpk8obqA9MZgXT416Q5711SDT7dQLTLk=
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
27 changes: 0 additions & 27 deletions pkg/distribution/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,33 +455,6 @@ func (b *Builder) WithChatTemplateFile(path string) (*Builder, error) {
}, nil
}

// WithConfigArchive adds a config archive (tar) file to the artifact.
func (b *Builder) WithConfigArchive(path string) (*Builder, error) {
// Check if config archive already exists.
layers, err := b.model.Layers()
if err != nil {
return nil, fmt.Errorf("get model layers: %w", err)
}

for _, layer := range layers {
mediaType, mediaTypeErr := layer.MediaType()
if mediaTypeErr == nil && mediaType == types.MediaTypeVLLMConfigArchive {
return nil, fmt.Errorf("model already has a config archive layer")
}
}

mt := b.resolveLayerMediaType(types.MediaTypeVLLMConfigArchive)
configLayer, err := partial.NewLayer(path, mt)
if err != nil {
return nil, fmt.Errorf("config archive layer from %q: %w", path, err)
}
return &Builder{
model: mutate.AppendLayers(b.model, configLayer),
originalLayers: b.originalLayers,
outputFormat: b.outputFormat,
}, nil
}

// Target represents a build target
type Target interface {
Write(context.Context, types.ModelArtifact, io.Writer) error
Expand Down
19 changes: 0 additions & 19 deletions pkg/distribution/builder/from_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/docker/model-runner/pkg/distribution/files"
"github.com/docker/model-runner/pkg/distribution/format"
"github.com/docker/model-runner/pkg/distribution/internal/mutate"
"github.com/docker/model-runner/pkg/distribution/internal/partial"
"github.com/docker/model-runner/pkg/distribution/modelpack"
"github.com/docker/model-runner/pkg/distribution/oci"
Expand Down Expand Up @@ -382,21 +381,3 @@ func fileTypeToMediaType(ft files.FileType) oci.MediaType {
return types.MediaTypeModelFile
}
}

// WithFileLayer adds an individual file layer with a relative path annotation.
// This is useful for adding files that should be extracted to a specific path.
func (b *Builder) WithFileLayer(absPath, relPath string) (*Builder, error) {
// Classify the file to determine media type
fileType := files.Classify(absPath)
mediaType := fileTypeToMediaType(fileType)

layer, err := partial.NewLayerWithRelativePath(absPath, relPath, mediaType)
if err != nil {
return nil, fmt.Errorf("file layer from %q: %w", absPath, err)
}

return &Builder{
model: mutate.AppendLayers(b.model, layer),
originalLayers: b.originalLayers,
}, nil
}
9 changes: 0 additions & 9 deletions pkg/distribution/huggingface/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@ func WithToken(token string) ClientOption {
}
}

// WithTransport sets the HTTP transport for the client
func WithTransport(transport http.RoundTripper) ClientOption {
return func(c *Client) {
if transport != nil {
c.httpClient.Transport = transport
}
}
}

// WithUserAgent sets the User-Agent header for requests
func WithUserAgent(userAgent string) ClientOption {
return func(c *Client) {
Expand Down
5 changes: 0 additions & 5 deletions pkg/distribution/huggingface/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,3 @@ func (pr *progressReader) Read(p []byte) (n int, err error) {
}
return n, err
}

// DownloadSingleFile downloads a single file and returns its local path
func (d *Downloader) DownloadSingleFile(ctx context.Context, file RepoFile) (string, error) {
return d.downloadFileWithProgress(ctx, file, uint64(file.ActualSize()), nil)
}
11 changes: 0 additions & 11 deletions pkg/distribution/internal/mutate/mutate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,3 @@ func ContextSize(mdl types.ModelArtifact, cs int32) types.ModelArtifact {
contextSize: &cs,
}
}

// SetManifestOptions applies manifest-level metadata (config media type and
// artifact type) to the given model. The options propagate through subsequent
// mutate wrappers via GetManifestOptions.
func SetManifestOptions(mdl types.ModelArtifact, configMT oci.MediaType, artifactType string) types.ModelArtifact {
return &model{
base: mdl,
configMediaType: configMT,
artifactType: artifactType,
}
}
9 changes: 0 additions & 9 deletions pkg/distribution/internal/progress/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,6 @@ func WriteError(w io.Writer, message string, mode oci.Mode) error {
})
}

// WriteWarning writes a warning message
func WriteWarning(w io.Writer, message string, mode oci.Mode) error {
return write(w, oci.ProgressMessage{
Type: oci.TypeWarning,
Message: message,
Mode: mode,
})
}

// write writes a JSON-formatted progress message to the writer
func write(w io.Writer, msg oci.ProgressMessage) error {
if w == nil {
Expand Down
21 changes: 0 additions & 21 deletions pkg/distribution/internal/utils/utils.go

This file was deleted.

8 changes: 0 additions & 8 deletions pkg/distribution/oci/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type options struct {
userAgent string
auth authn.Authenticator
keychain authn.Keychain
progress chan<- oci.Update
plainHTTP bool
}

Expand Down Expand Up @@ -85,13 +84,6 @@ func WithAuthFromKeychain(kc authn.Keychain) Option {
}
}

// WithProgress sets a channel for receiving progress updates.
func WithProgress(ch chan<- oci.Update) Option {
return func(o *options) {
o.progress = ch
}
}

// WithPlainHTTP allows connecting to registries using plain HTTP instead of HTTPS.
func WithPlainHTTP(plain bool) Option {
return func(o *options) {
Expand Down
11 changes: 0 additions & 11 deletions pkg/distribution/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@ func WithUserAgent(userAgent string) ClientOption {
}
}

func WithAuthConfig(username, password string) ClientOption {
return func(c *Client) {
if username != "" && password != "" {
c.auth = &authn.Basic{
Username: username,
Password: password,
}
}
}
}

// WithAuth sets a custom authenticator.
func WithAuth(auth authn.Authenticator) ClientOption {
return func(c *Client) {
Expand Down
36 changes: 0 additions & 36 deletions pkg/distribution/tarball/file.go

This file was deleted.

13 changes: 0 additions & 13 deletions pkg/distribution/tarball/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ type Reader struct {
done bool
}

type Blob struct {
diffID oci.Hash
rc io.ReadCloser
}

func (b Blob) DiffID() (oci.Hash, error) {
return b.diffID, nil
}

func (b Blob) Uncompressed() (io.ReadCloser, error) {
return b.rc, nil
}

func (r *Reader) Next() (oci.Hash, error) {
for {
hdr, err := r.tr.Next()
Expand Down
7 changes: 0 additions & 7 deletions pkg/envconfig/envconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ func Var(key string) string {
return strings.Trim(strings.TrimSpace(os.Getenv(key)), "\"'")
}

// String returns a lazy string accessor for the given environment variable.
func String(key string) func() string {
return func() string {
return Var(key)
}
}

// BoolWithDefault returns a lazy bool accessor for the given environment variable,
// allowing a caller-specified default. If the variable is set but cannot be parsed
// as a bool, the defaultValue is returned.
Expand Down
2 changes: 0 additions & 2 deletions pkg/inference/backends/llamacpp/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const (
)

var (
ShouldUseGPUVariant bool
ShouldUseGPUVariantLock sync.Mutex
ShouldUpdateServer = true
ShouldUpdateServerLock sync.Mutex
DesiredServerVersion = "latest"
Expand Down
28 changes: 0 additions & 28 deletions pkg/inference/backends/llamacpp/download_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"context"
"fmt"
"net/http"
"path/filepath"
"runtime"

"github.com/docker/model-runner/pkg/inference"
"github.com/docker/model-runner/pkg/logging"
Expand All @@ -14,34 +12,8 @@ import (
func (l *llamaCpp) ensureLatestLlamaCpp(ctx context.Context, log logging.Logger, httpClient *http.Client,
llamaCppPath, vendoredServerStoragePath string,
) error {
nvGPUInfoBin := filepath.Join(vendoredServerStoragePath, "com.docker.nv-gpu-info.exe")
var canUseCUDA11, canUseOpenCL bool
var err error
ShouldUseGPUVariantLock.Lock()
defer ShouldUseGPUVariantLock.Unlock()
if ShouldUseGPUVariant {
switch runtime.GOARCH {
case "amd64":
canUseCUDA11, err = hasCUDA11CapableGPU(ctx, nvGPUInfoBin)
if err != nil {
l.status = inference.FormatError(fmt.Sprintf("failed to check CUDA 11 capability: %v", err))
return fmt.Errorf("failed to check CUDA 11 capability: %w", err)
}
case "arm64":
canUseOpenCL, err = hasOpenCL()
if err != nil {
l.status = inference.FormatError(fmt.Sprintf("failed to check OpenCL capability: %v", err))
return fmt.Errorf("failed to check OpenCL capability: %w", err)
}
}
}
desiredVersion := GetDesiredServerVersion()
desiredVariant := "cpu"
if canUseCUDA11 {
desiredVariant = "cuda"
} else if canUseOpenCL {
desiredVariant = "opencl"
}
l.status = inference.FormatInstalling(fmt.Sprintf("%s llama.cpp %s", inference.DetailCheckingForUpdates, desiredVariant))
return l.downloadLatestLlamaCpp(ctx, log, httpClient, llamaCppPath, vendoredServerStoragePath, desiredVersion,
desiredVariant)
Expand Down
7 changes: 0 additions & 7 deletions pkg/inference/backends/llamacpp/gpuinfo_notwindows.go

This file was deleted.

Loading
Loading