Skip to content

server: resolve asset paths relative to executable#106

Open
gmontana wants to merge 1 commit into
antirez:mainfrom
gmontana:fix/binary-relative-paths
Open

server: resolve asset paths relative to executable#106
gmontana wants to merge 1 commit into
antirez:mainfrom
gmontana:fix/binary-relative-paths

Conversation

@gmontana
Copy link
Copy Markdown

Summary

Fixes #49 by resolving relative asset paths from the executable directory when they are not found from the current working directory.

This covers:

  • relative GGUF model paths, including the default ds4flash.gguf
  • relative MTP model paths
  • bundled Metal source files such as metal/flash_attn.metal

Current-directory paths still take precedence, and the existing Metal source environment overrides are still tried first.

Validation

  • git diff --check
  • make ds4_test
  • ./ds4_test --paths --server
  • make ds4-server
  • make ds4
  • launched /Users/u1770777/repos/ds4/ds4-server --ctx 2048 --port 5556 from /tmp and confirmed it reached listening on http://127.0.0.1:5556

When a relative model or Metal source path is not found from the current working directory, try the same path relative to the running executable.

This lets launchers execute ds4-server by absolute path from another working directory while preserving current-directory precedence and existing environment overrides.
@gmontana
Copy link
Copy Markdown
Author

I saw the note on #49 about possibly inlining the Metal sources at build time. This PR is meant as a smaller runtime lookup fix for the current layout: it keeps CWD precedence and existing Metal source env overrides, but lets launchers start ds4-server by absolute path from another working directory.

It also covers the default model path / MTP path case, which inlining Metal sources would not address. Happy to adjust the scope if you prefer a different split.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problems when launching from other programs like llama-swap

1 participant