Al3ssio-urs0/devstral-coding-helper
0
Devstral / Mistral Coding Helper
This Space can run in two ways. Only one file should be named app.py.
Variant A — Hugging Face Inference API (no GPU required)
- Ensure the file
app_hf.pyis renamed to `app.py`. - Go to Settings → Variables and add:
HF_TOKEN = hf_...(your Hugging Face token with the Read role)- (optional)
MODEL_ID = mistralai/Mistral-7B-Instruct-v0.3 - Wait for the Space to rebuild and click App to test.
Variant B — Mistral API (use Devstral)
- Ensure the file
app_mistral.pyis renamed to `app.py`. - Go to Settings → Variables and add:
MISTRAL_API_KEY = ...(from https://console.mistral.ai/)- (optional)
MISTRAL_MODEL = devstral-small-latest - (optional)
MISTRAL_BASE_URL = https://api.mistral.ai/v1 - Wait for the Space to rebuild and click App to test.
Troubleshooting
- “configuration error / Missing configuration in README” → You’re missing this YAML block at the top of README. Keep it exactly as shown.
- KeyError: 'HF_TOKEN' or 'MISTRAL_API_KEY' → Add the missing variable in Settings → Variables, then restart.
- App keeps Building / Error → Check Logs; ensure
requirements.txtis present and the correct file is namedapp.py. - Wrong variant running → Only one file should be
app.py. Rename the other back toapp_hf.pyorapp_mistral.py.
