Skip to content

Development and Testing

Backend:

Terminal window
cargo fmt
cargo check
cargo clippy --workspace --all-targets
cargo test --workspace
cargo run -p gproxy

Frontend:

Terminal window
cd apps/gproxy/frontend
pnpm install
pnpm typecheck
pnpm build

Built-in scripts:

  • tests/provider/curl_provider.sh
  • tests/provider/run_channel_regression.sh

Examples:

Terminal window
API_KEY='<key>' tests/provider/curl_provider.sh \
--provider openai \
--method openai_chat \
--model gpt-4.1
Terminal window
API_KEY='<key>' tests/provider/run_channel_regression.sh \
--provider openai \
--model gpt-5-nano \
--embedding-model text-embedding-3-small

If custom channel mode is not enough for your upstream (for example custom auth flow, special path rules, custom response normalization, or deeper conversion behavior), contribute a native channel implementation.

  1. Add a channel module under crates/gproxy-provider/src/channels/<your_channel>/.
  2. Implement needed files: settings.rs, credential.rs, dispatch.rs, upstream.rs, mod.rs.
  3. Register channel enum and string id in crates/gproxy-provider/src/channel.rs.
  4. Register channel capability metadata and default dispatch in crates/gproxy-provider/src/registry.rs.
  5. Add settings parse/serialize wiring in crates/gproxy-provider/src/settings.rs.
  6. Wire channel execution in crates/gproxy-provider/src/provider.rs.
  7. If channel supports OAuth or upstream usage, wire corresponding runtime branches.
  1. Add channel files under apps/gproxy/frontend/src/modules/admin/providers/channels/<your_channel>/.
  2. Register the channel in frontend channel registry so it appears in admin UI.
Terminal window
cargo check
cargo test --workspace
Terminal window
tests/provider/curl_provider.sh
tests/provider/run_channel_regression.sh

Default paths:

  • data dir: ./data
  • default DB: sqlite://./data/gproxy.db?mode=rwc
  • tokenizer cache: ./data/tokenizers

dsn can be switched to mysql/postgres.