> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# DSPy

> TokenLab'i DSPy içinde OpenAI uyumlu bir dil modeli olarak yapılandırın

## Genel Bakış

DSPy, TokenLab'in OpenAI uyumlu `/v1` uç noktasını kullanarak `openai/` sağlayıcı ön eki ile TokenLab'i çağırabilir.

<Note>
  **Tür**: Programlama Çerçevesi

  **Birincil Yol**: OpenAI uyumlu dil modeli çağrıları

  **Destek Güveni**: Desteklenen özel uç nokta yolu
</Note>

## Ortam

```bash theme={null}
export TOKENLAB_API_KEY="sk-your-tokenlab-key"
```

## DSPy Yapılandırması

```python theme={null}
import os

import dspy

lm = dspy.LM(
    "openai/claude-sonnet-5",
    api_key=os.environ["TOKENLAB_API_KEY"],
    api_base="https://api.tokenlab.sh/v1",
)

dspy.configure(lm=lm)
```

## Bir Modül Kullanımı

```python theme={null}
qa = dspy.ChainOfThought("question -> answer")

response = qa(question="What should I monitor in an LLM gateway?")
print(response.answer)
```

## Model Önerileri

Hızlı denemeler için `gpt-5.4-mini`, daha güçlü akıl yürütme izleri için `claude-sonnet-5` ve hızlı yineleme döngüleri için `deepseek-v4-flash` kullanın.
