-
-
Notifications
You must be signed in to change notification settings - Fork 222
Custom API Templates Discussion #126
-
Custom API Templates
Is ChatterUI missing an API you want to use?
v0.8.3 introduces API Configurations, which allows you to create customized endpoints (to a degree) which are missing from ChatterUI. Since these configs are JSON files, you can share them with other users!
Creating your own config is great if you are using an API which isn't handled by the existing API templates. You can cover use cases such as:
- is like OpenAI's, but it needs this extra sampler field!
- I have Ollama, but I want a configuration that adds an auth header!
- This API has differing model and completion endpoints!
Refer to this document on how to build your API template! Then, simply go to API Manager > Gear Icon > Add Template to load it into ChatterUI!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 9 comments 13 replies
-
Can you share the horde template in previous version? The new beta seems to have deleted it? Or it's a bug because I saw the horde.ts file is still there. Anyway, thanks.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hey there, I haven't gotten around implementing horde properly just yet for the new API system!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Horde is now available again, both in the Legacy and new API systems:
https://github.com/Vali-98/ChatterUI/releases/tag/v0.8.3
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Saw it, thanks. But can you deselect the disappeared models? I found that after one model disappeared from the list the setting still keeps that, and I guess that leads to error.
Beta Was this translation helpful? Give feedback.
All reactions
-
The link is broken. I found the.md file in the /lib folder.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for pointing that out! There was a folder restructure and this page wasn't updated.
Beta Was this translation helpful? Give feedback.
All reactions
-
Got weird black screen when importing the template file. No errors found in log
Beta Was this translation helpful? Give feedback.
All reactions
-
You could provide the json that causes the error for testing.
Beta Was this translation helpful? Give feedback.
All reactions
-
example json is unusable as well as this one
Details
{
"version": 1,
"name": "DeepSeek-V3",
"defaultValues": {
"endpoint": "https://api.deepseek.com/chat/completions",
"modelEndpoint": "https://api.deepseek.com/models",
"key": "",
"model": "deepseek-chat"
},
"features": {
"usePrefill": false,
"useFirstMessage": false,
"useKey": true,
"useModel": true,
"multipleModels": false
},
"request": {
"requestType": "stream",
"samplerFields": [
{
"externalName": "max_context_length",
"samplerID": "max_length"
},
{
"externalName": "max_tokens",
"samplerID": "genamt"
},
{
"externalName": "stream",
"samplerID": "streaming"
},
{
"externalName": "temperature",
"samplerID": "temp"
},
{
"externalName": "top_p",
"samplerID": "top_p"
},
{
"externalName": "presence_penalty",
"samplerID": "presence_pen"
},
{
"externalName": "frequency_penalty",
"samplerID": "freq_pen"
},
{
"externalName": "seed",
"samplerID": "seed"
}
],
"completionType": {
"type": "chatCompletions",
"userRole": "user",
"systemRole": "system",
"assistantRole": "assistant",
"contentName": "content"
},
"authHeader": "Authorization",
"authPrefix": "Bearer ",
"responseParsePattern": "choices.0.delta.content",
"useStop": true,
"stopKey": "stop",
"promptKey": "messages",
"removeLength": true
},
"payload": {
"type": "openai"
},
"model": {
"useModelContextLength": false,
"nameParser": "id",
"contextSizeParser": "",
"modelListParser": "data"
},
"ui": {
"editableCompletionPath": true,
"editableModelPath": true,
"selectableModel": true
}
}Beta Was this translation helpful? Give feedback.
All reactions
-
example json is unusable as well as this one
I was unable to reproduce this, I imported this template just fine.
Beta Was this translation helpful? Give feedback.
All reactions
-
Then I really need a special apk for debugging purposes... Maybe it's my system's problem
Beta Was this translation helpful? Give feedback.
All reactions
-
btw import character feature does not work either, all permissions were granted
Beta Was this translation helpful? Give feedback.
All reactions
-
Is there a public api I can use to query the model sending queries via Tasker to model (gemma-3-4b-it-q4_k_m.gguf offline) through ChatterUI. My goal is to interact with model via voice commands, hands free using Tasker as sort of a middleman. when the model replies, Tasker will intercept reply, parce relevant data and trigger any Tasker tasks, etc.which are setup to be activated based on model's replies.
Example:
I activate voice recognition and give query to Tasker via get voice or AutoVoice, etc.
"JARVIS . (Trigger) Tell me a funny joke to start the day and then I need the weather Forcast for the day."
Tasker sends the query to the model who processes the request, sends reply back to Tasker which will read joke Aloud via "say" action, and fire up the weather forecast task. I could of course obviously just load the app up on screen and type away to the model and wait for my reply and then just fire up the weather but that's no fun and not very cool when you can converse with the "assistant" while you're scrolling through Instagram or something and Tasker is firing up weather to be spoken to me Aloud while I'm in another app as well. Front end is great for sitting down and reading responses comfortably but if you're trying to multitask on the go, a basically handsfree conversation with the model and the model's replies helping trigger useful tasker tasks would be a Game changer.
Outstanding app, btw.
It IS my daily driver! 💯
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm having a lot of trouble figuring out how to make this custom template work.
For reference, I'm running Bitnet on ik_llama.cpp server in termux.
input:
{
"prompt": "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\nHello, who are you?<|im_end|>\n<|im_start|>assistant\n",
"temperature": 0.7,
"n_predict": 128,
"stop": [
"<|im_end|>"
]
}
output:
{
"content": "I am an AI assistant designed to help you find information and answer your questions. How can I assist you today? ",
"id_slot": 0,
"stop": true,
"model": "./models/bitnet.gguf",
"tokens_predicted": 28,
"tokens_evaluated": 47,
"generation_settings": {
"n_ctx": 4096,
"n_predict": -1,
"model": "./models/bitnet.gguf",
"seed": 4294967295,
"temperature": 0.699999988079071,
"dynatemp_range": 0,
"dynatemp_exponent": 1,
"top_k": 40,
"top_p": 0.949999988079071,
"min_p": 0.05000000074505806,
"tfs_z": 1,
"typical_p": 1,
"repeat_last_n": 64,
"repeat_penalty": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"penalty_prompt_tokens": [],
"use_penalty_prompt_tokens": false,
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.10000000149011612,
"penalize_nl": false,
"stop": [
"<|im_end|>"
],
"n_keep": 0,
"n_discard": 0,
"ignore_eos": false,
"stream": false,
"logit_bias": [],
"n_probs": 0,
"min_keep": 0,
"grammar": "",
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
]
},
"prompt": "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\nHello, who are you?<|im_end|>\n<|im_start|>assistant\n",
"truncated": false,
"stopped_eos": false,
"stopped_word": true,
"stopped_limit": false,
"stopping_word": "<|im_end|>",
"tokens_cached": 74,
"timings": {
"prompt_n": 47,
"prompt_ms": 4828.648,
"prompt_per_token_ms": 102.7371914893617,
"prompt_per_second": 9.733573455758215,
"predicted_n": 28,
"predicted_ms": 4568.995,
"predicted_per_token_ms": 163.17839285714285,
"predicted_per_second": 6.128262342156208
}
}
I have managed to get a correct payload to send and response from my server, but chatter seems unable to parse it.
The template guide it seems is focused on request formatting, but not response parsing. Not sure if I'm overlooking something?
Beta Was this translation helpful? Give feedback.
All reactions
-
All right, I finally got it squared away. Here's the config file you'll need:
{
"version": 1,
"name": "Local Bitnet",
"defaultValues": {
"endpoint": "http://127.0.0.1:8080/completion",
"modelEndpoint": "",
"prefill": "",
"firstMessage": "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\nHello, who are you?<|im_end|>\n<|im_start|>assistant\n",
"key": "",
"model": ""
},
"features": {
"usePrefill": false,
"useFirstMessage": false,
"useKey": true,
"useModel": true,
"multipleModels": false
},
"request": {
"requestType": "stream",
"samplerFields": [
{
"externalName": "max_context_length",
"samplerID": "max_length"
},
{
"externalName": "n_predict",
"samplerID": "genamt"
},
{
"externalName": "stream",
"samplerID": "streaming"
},
{
"externalName": "temperature",
"samplerID": "temp"
},
{
"externalName": "top_p",
"samplerID": "top_p"
},
{
"externalName": "presence_penalty",
"samplerID": "presence_pen"
},
{
"externalName": "frequency_penalty",
"samplerID": "freq_pen"
},
{
"externalName": "seed",
"samplerID": "seed"
}
],
"completionType": {
"type": "Local Bitnet",
"userRole": "<|im_start|>user",
"systemRole": "<|im_start|>system",
"assistantRole": "<|im_start|>assistant",
"contentName": "content"
},
"authHeader": "Authorization",
"authPrefix": "Bearer ",
"responseParsePattern": "content",
"useStop": true,
"stopKey": "stop",
"promptKey": "prompt",
"removeLength": true
},
"payload": {
"type": "openai"
},
"model": {
"useModelContextLength": false,
"nameParser": "id",
"contextSizeParser": "",
"modelListParser": "data"
},
"ui": {
"editableCompletionPath": false,
"editableModelPath": false,
"selectableModel": false
},
"prompt": "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\nHello, who are you?<|im_end|>\n<|im_start|>assistant\n",
"temperature": 0.7,
"n_predict": 128,
"stop": [
"<|im_end|>"
]
}
I recommend turning streaming off for Bitnet, if you use the TTS.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Does anyone have a template for Google's API that includes the safetySettings parameters?
Beta Was this translation helpful? Give feedback.
All reactions
-
Could you please add Deepseek and Grok to the list of API providers?
Beta Was this translation helpful? Give feedback.
All reactions
-
Does the generic Chat Completions not work for these?
Beta Was this translation helpful? Give feedback.
All reactions
-
Chutes anyone?
I can't connect to chutes API directly.
Beta Was this translation helpful? Give feedback.
All reactions
-
I use qwen 3.5 9b model on llmacpp server. It works perfectly fine without thinking.
How do I make the template work with thinking tough?
Any ideas?
Beta Was this translation helpful? Give feedback.