Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

update sglang site to new url (#1740)

arnavsinghvi119391c2a9b386
diff --git a/docs/docs/building-blocks/1-language_models.md b/docs/docs/building-blocks/1-language_models.md
index 19560b851..41d90cfc9 100644
--- a/docs/docs/building-blocks/1-language_models.md
+++ b/docs/docs/building-blocks/1-language_models.md
@@ -118,7 +118,7 @@ Any OpenAI-compatible endpoint is easy to set up with an `openai/` prefix as wel
#### Setting up SGLang
-1. **Install SGLang (adapted from SGLang [documentation](https://sglang.readthedocs.io/en/latest/install.html)):**
+1. **Install SGLang (adapted from SGLang [documentation](https://sgl-project.github.io/starts/install.html)):**
```bash
pip install "sglang[all]"
@@ -158,13 +158,16 @@ Any OpenAI-compatible endpoint is easy to set up with an `openai/` prefix as wel
```python
sglang_port = 7501
sglang_url = f"http://localhost:{sglang_port}/v1"
- sglang_llama = dspy.LM("openai/meta-llama/Meta-Llama-3-8B-Instruct", api_base=sglang_url)
+
+ # To avoid potential errors from LiteLLM when querying the SGLang endpoint, you may need to set api_key = ""
+
+ sglang_llama = dspy.LM("openai/meta-llama/Meta-Llama-3-8B-Instruct", api_base=sglang_url, api_key = "")
# You could also use text mode, in which the prompts are *not* formatted as messages.
- sglang_llama_text = dspy.LM("openai/meta-llama/Meta-Llama-3-8B-Instruct", api_base=sglang_url, model_type='text')
+ sglang_llama_text = dspy.LM("openai/meta-llama/Meta-Llama-3-8B-Instruct", api_base=sglang_url, model_type='text', api_key = "")
```
- For further details on customizing the SGLang configuration, please refer to the [SGLang documentation](https://sglang.readthedocs.io/en/latest/backend.html#additional-server-arguments).
+ For further details on customizing the SGLang configuration, please refer to the [SGLang documentation](https://sgl-project.github.io/backend/backend.html#additional-server-arguments).
#
Additionally, you can also host models locally through Ollama.