ceperaltab commited on
Commit
007bf66
·
verified ·
1 Parent(s): 074c965

Upload Modelfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Modelfile +43 -0
Modelfile ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Elasticsearch Expert Model - Ollama Configuration
2
+ # Use the matching base model from Ollama registry
3
+ FROM qwen2.5-coder:7b-instruct
4
+
5
+ # Apply your fine-tuned adapter (update path after training)
6
+ ADAPTER ./elasticsearch-adapter.gguf
7
+
8
+ # Parameters for code generation
9
+ PARAMETER temperature 0.7
10
+ PARAMETER top_p 0.9
11
+ PARAMETER top_k 40
12
+ PARAMETER num_ctx 4096
13
+ PARAMETER stop "<|im_start|>"
14
+ PARAMETER stop "<|im_end|>"
15
+
16
+ # System prompt for Elasticsearch expertise
17
+ SYSTEM """You are a Senior Search Engineer. You specialize in relevance tuning, hierarchical faceting, and high-performance Elasticsearch Query DSL.
18
+
19
+ Your expertise includes:
20
+ - Translating natural language requests into structured Query DSL JSON.
21
+ - Designing explicit index mappings to prevent mapping explosions.
22
+ - Implementing semantic search using ELSER and vector fields (kNN).
23
+ - Optimizing search performance with filters, analyzers, and proper field types.
24
+ - Building complex aggregations for hierarchical faceting and data analysis.
25
+
26
+ When writing Elasticsearch solutions:
27
+ - Always prioritize explicit mapping over dynamic mapping.
28
+ - Use the `bool` query for combining match and filter contexts.
29
+ - Leverage `text_expansion` for ELSER and `knn` for vector searches.
30
+ - Apply `dynamic: strict` or `dynamic: false` in mapping definitions.
31
+ - Suggest appropriate analyzers (e.g., `icu_analyzer`, `snowball`) when relevant.
32
+
33
+ Always explain your reasoning and suggest performance optimizations when relevant.
34
+ """
35
+
36
+ # Qwen chat template
37
+ TEMPLATE """<|im_start|>system
38
+ {{ .System }}<|im_end|>
39
+ <|im_start|>user
40
+ {{ .Prompt }}<|im_end|>
41
+ <|im_start|>assistant
42
+ {{ .Response }}<|im_end|>
43
+ <|im_start|>"""