Skip to content

🔧 Add configuration file support #5

@Gilfeather

Description

@Gilfeather

Description

Add support for loading server configuration from a TOML file instead of only command-line arguments.

Acceptance Criteria

  • Create Config struct in new src/config.rs file
  • Support loading from furnace.toml file
  • Include settings: port, host, model_name, log_level, backend, max_concurrent_requests
  • Command-line args should override config file values
  • Add example furnace.toml file to repository
  • Update CLI help text to mention config file

Updated Configuration Items

Since the CLI has been updated to use built-in models, the config should include:

  • model_name (instead of model_path)
  • backend (cpu, wgpu, metal, cuda)
  • enable_kernel_fusion
  • enable_autotuning
  • max_concurrent_requests

Example furnace.toml

[server]
host = "127.0.0.1"
port = 3000
log_level = "info"
max_concurrent_requests = 100

[model]
name = "resnet18"
backend = "cpu"
enable_kernel_fusion = false
enable_autotuning = false

Implementation Guidance

  • Use the toml crate for parsing
  • Use serde for deserialization
  • Modify main.rs to check for config file before parsing CLI args
  • Use clap's value precedence features
  • Update for current CLI structure with --model-name

Estimated Difficulty

Medium - 1-2 days

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions