ChatOpenAI from langchain-openai, pointed at Inferit's OpenAI-compatible base URL with your API key. Guide: https://inferit.cc/docs/guides/langchain
Testnet demo: test tokens, no monetary value. Requests are paid in ITC (Inferit Test Credit).
| File | What it does |
|---|---|
chat.py |
One request with an API key (max_tokens 16) |
requirements.txt |
langchain-openai |
smoke.sh |
Makes a .venv here, installs the requirements and runs chat.py |
You need Python 3.10 or newer and an API key (ik_...) from https://inferit.app/buy.
export INFERIT_API_KEY='ik_...'
bash smoke.sh # or PYTHON=python3.12 bash smoke.shBy hand:
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
INFERIT_MODEL=qwen/qwen-2.5-14b-instruct .venv/bin/python chat.py| Variable | Default |
|---|---|
INFERIT_API_KEY |
required |
INFERIT_BASE_URL |
https://api-production-c74b9.up.railway.app/v1 (the hosted testnet API) |
INFERIT_MODEL |
auto in chat.py; smoke.sh picks one with ../pick-model.sh |
PYTHON |
python3 (smoke.sh only) |
reply.response_metadata["model_name"] names the model that answered, which matters with auto.
verified 2026-10-13: langchain-openai 1.7.1 on Python 3.12, model qwen/qwen-2.5-14b-instruct, max_tokens 16: "Hello, how can I assist?" (model: qwen/qwen-2.5-14b-instruct).