|
|
|
|
|
by mritchie712
808 days ago
|
|
Not sure when they implemented this, but ollama now has a JSON mode [0]. Not function calling, but one of the simpler ways to get JSON in a local LLM. I'm using it with `knoopx/hermes-2-pro-mistral:7b-q8_0` and it's worked well for me so far. response = ollama.chat(model=OLLAMA_MODEL,
messages=[
{
'role': 'system',
'content': system_message,
},
{
'role': 'user',
'content': user_prompt,
},
],
format='json',
options = {
#'temperature': 1.5, # very creative
'temperature': 0.0
}
)
0 - https://github.com/ollama/ollama/blob/main/docs/api.md#json-... |
|