Integrations
LlamaIndex
Get Started
Inference Engines
Model Gateway
Router Tags
Structured Outputs
Integrations
Pricing
Integrations
LlamaIndex
Call the Neutrino Router using LlamaIndex
Usage
from llama_index.llms import Neutrino
from llama_index.llms import ChatMessage
import os
os.environ["NEUTRINO_API_KEY"] = "<your-neutrino-api-key>"
llm = Neutrino(
# api_key="<Neutrino-API-Key>",
# router="your-neutrino-router-id", # (or 'default')
)
message = ChatMessage(
role="user",
content="Explain the difference between statically typed and dynamically typed languages.",
)
resp = llm.chat([message])
print(f"Optimal model: {resp.raw['model']}")
print(resp)
On this page