Hello
I could be exposing my ignorance here on how Hugging Face and its API is meant to be used...
Registered with Hugging Face, got their Auth token.
Tried issuing some curl based commands like:
curl https://router.huggingface.co/hf-inference/models/Qwen/Qwen3-235B-A22B/v1/chat/completions \
-H "Authorization: Bearer ${HF}" \
-H 'Content-Type: application/json' \
-d '{
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "Qwen/Qwen3-235B-A22B",
"stream": false
}'
and that works. As in, I can authenticate correctly.
I've tried this:
(use-package starhugger
:init
(setq starhugger-hugging-face-api-token (auth-source-pick-first-password :host "huggingface.co"))
:config
(setq starhugger-auto-idle-time 0.05
starhugger-completion-backend-function #'starhugger-hugging-face-inference-api
starhugger-model-id "codellama"))
I open a sample buffer foo.py and enter print followed by M-x starhugger-trigger-suggestion only to see the following in *Messages* buffer:
You can run the command ‘starhugger-trigger-suggestion’ with M-x st-t-
error in process filter: could not parse JSON stream: 2, 1, 2 [2 times]
What am I doing wrong?
Thanks
Hello
I could be exposing my ignorance here on how Hugging Face and its API is meant to be used...
Registered with Hugging Face, got their Auth token.
Tried issuing some
curlbased commands like:curl https://router.huggingface.co/hf-inference/models/Qwen/Qwen3-235B-A22B/v1/chat/completions \ -H "Authorization: Bearer ${HF}" \ -H 'Content-Type: application/json' \ -d '{ "messages": [ { "role": "user", "content": "What is the capital of France?" } ], "max_tokens": 512, "model": "Qwen/Qwen3-235B-A22B", "stream": false }'and that works. As in, I can authenticate correctly.
I've tried this:
I open a sample buffer
foo.pyand enterprintfollowed byM-x starhugger-trigger-suggestiononly to see the following in*Messages*buffer:What am I doing wrong?
Thanks