MCPcopy Create free account
hub / github.com/mudler/LocalAI / writeChatMLClassifierModel

Function writeChatMLClassifierModel

core/http/middleware/route_model_test.go:477–496  ·  view source on GitHub ↗

writeChatMLClassifierModel writes a classifier model YAML that mirrors the live arch-router-1.5b.yaml shipped at volumes/models/arch-router-1.5b.yaml: ChatML chat + chat_message templates, score usecase, <|im_end|> first in stopwords.

(modelDir, name string)

Source from the content-addressed store, hash-verified

475// volumes/models/arch-router-1.5b.yaml: ChatML chat + chat_message
476// templates, score usecase, <|im_end|> first in stopwords.
477func writeChatMLClassifierModel(modelDir, name string) {
478 body := `name: ` + name + `
479backend: llama-cpp
480known_usecases:
481 - score
482stopwords:
483 - <|im_end|>
484 - <|endoftext|>
485template:
486 chat: |
487 {{.Input -}}
488 <|im_start|>assistant
489 chat_message: |
490 <|im_start|>{{ .RoleName }}
491 {{- if .Content }}
492 {{ .Content }}
493 {{- end }}<|im_end|>
494`
495 Expect(os.WriteFile(filepath.Join(modelDir, name+".yaml"), []byte(body), 0o644)).To(Succeed())
496}
497
498// writeLlama3StyleClassifierModel writes a classifier model mirroring
499// gallery/llama3-instruct.yaml — stopwords defensively list <|im_end|>

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected