Repository: tensorzero/tensorzero (language: rust)

Issue:
Add SGLang example
We're missing the example from https://www.tensorzero.com/docs/gateway/guides/providers/sglang.


Discussion / hints:

Fix patch:
diff --git a/examples/guides/providers/sglang/README.md b/examples/guides/providers/sglang/README.md
new file mode 100644
index 000000000..3516aa27f
--- /dev/null
+++ b/examples/guides/providers/sglang/README.md
@@ -0,0 +1,3 @@
+# Getting Started with SGLang
+
+See the [Getting Started with SGLang](https://www.tensorzero.com/docs/gateway/guides/providers/sglang) guide for more information.
diff --git a/examples/guides/providers/sglang/config/tensorzero.toml b/examples/guides/providers/sglang/config/tensorzero.toml
new file mode 100644
index 000000000..9b5505e42
--- /dev/null
+++ b/examples/guides/providers/sglang/config/tensorzero.toml
@@ -0,0 +1,15 @@
+[models.llama]
+routing = ["sglang"]
+
+[models.llama.providers.sglang]
+type = "sglang"
+api_base = "http://host.docker.internal:8080/v1/"  # for SGLang running locally on the host
+api_key_location = "none"  # by default, SGLang requires no API key
+model_name = "my-sglang-model"
+
+[functions.my_function_name]
+type = "chat"
+
+[functions.my_function_name.variants.my_variant_name]
+type = "chat_completion"
+model = "llama"
diff --git a/examples/guides/providers/sglang/docker-compose.yml b/examples/guides/providers/sglang/docker-compose.yml
new file mode 100644
index 000000000..00bb8e546
--- /dev/null
+++ b/examples/guides/providers/sglang/docker-compose.yml
@@ -0,0 +1,15 @@
+# This is a simplified example for learning purposes. Do not use this in production.
+# For production-ready deployments, see: https://www.tensorzero.com/docs/gateway/deployment
+
+services:
+  gateway:
+    image: tensorzero/gateway
+    volumes:
+      - ./config:/app/config:ro
+    # environment:
+    #   - SGLANG_API_KEY=${SGLANG_API_KEY:?Environment variable SGLANG_API_KEY must be set.}
+    ports:
+      - "3000:3000"
+    # The following entry is needed if SGLang runs on the host machine. If it runs on a separate server, you can remove it.
+    extra_hosts:
+      - "host.docker.internal:host-gateway"


Test patch: