from huggingface_hub import InferenceClient client = InferenceClient( provider="hf-inference", api_key="hf_xxxxxxxxxxxxxxxxxxxxxxxx", ) completion = client.chat.completions.create( model="microsoft/DialoGPT-medium", messages=[ { "role": "user", "content": "What is the capital of France?" } ], max_tokens=512, ) print(completion.choices[0].message)