mtrinistudio 0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. mtrinistudio-0.5/LICENSE.txt +17 -0
  2. mtrinistudio-0.5/MANIFEST.in +9 -0
  3. mtrinistudio-0.5/PKG-INFO +13 -0
  4. mtrinistudio-0.5/README.md +76 -0
  5. mtrinistudio-0.5/app/__init__.py +1 -0
  6. mtrinistudio-0.5/app/agents.py +74 -0
  7. mtrinistudio-0.5/app/agents_db.json +4052 -0
  8. mtrinistudio-0.5/app/auth.py +38 -0
  9. mtrinistudio-0.5/app/database.py +45 -0
  10. mtrinistudio-0.5/app/email_service.py +62 -0
  11. mtrinistudio-0.5/app/ggml-base.dll +0 -0
  12. mtrinistudio-0.5/app/ggml-cpu-alderlake.dll +0 -0
  13. mtrinistudio-0.5/app/ggml-cpu-cannonlake.dll +0 -0
  14. mtrinistudio-0.5/app/ggml-cpu-cascadelake.dll +0 -0
  15. mtrinistudio-0.5/app/ggml-cpu-cooperlake.dll +0 -0
  16. mtrinistudio-0.5/app/ggml-cpu-haswell.dll +0 -0
  17. mtrinistudio-0.5/app/ggml-cpu-icelake.dll +0 -0
  18. mtrinistudio-0.5/app/ggml-cpu-ivybridge.dll +0 -0
  19. mtrinistudio-0.5/app/ggml-cpu-piledriver.dll +0 -0
  20. mtrinistudio-0.5/app/ggml-cpu-sandybridge.dll +0 -0
  21. mtrinistudio-0.5/app/ggml-cpu-sapphirerapids.dll +0 -0
  22. mtrinistudio-0.5/app/ggml-cpu-skylakex.dll +0 -0
  23. mtrinistudio-0.5/app/ggml-cpu-sse42.dll +0 -0
  24. mtrinistudio-0.5/app/ggml-cpu-x64.dll +0 -0
  25. mtrinistudio-0.5/app/ggml-cpu-zen4.dll +0 -0
  26. mtrinistudio-0.5/app/ggml-rpc.dll +0 -0
  27. mtrinistudio-0.5/app/ggml-vulkan.dll +0 -0
  28. mtrinistudio-0.5/app/ggml.dll +0 -0
  29. mtrinistudio-0.5/app/icon.ico +0 -0
  30. mtrinistudio-0.5/app/icon.png +0 -0
  31. mtrinistudio-0.5/app/libomp140.x86_64.dll +0 -0
  32. mtrinistudio-0.5/app/llama-batched-bench-impl.dll +0 -0
  33. mtrinistudio-0.5/app/llama-bench-impl.dll +0 -0
  34. mtrinistudio-0.5/app/llama-cli-impl.dll +0 -0
  35. mtrinistudio-0.5/app/llama-common.dll +0 -0
  36. mtrinistudio-0.5/app/llama-completion-impl.dll +0 -0
  37. mtrinistudio-0.5/app/llama-fit-params-impl.dll +0 -0
  38. mtrinistudio-0.5/app/llama-perplexity-impl.dll +0 -0
  39. mtrinistudio-0.5/app/llama-quantize-impl.dll +0 -0
  40. mtrinistudio-0.5/app/llama-server-impl.dll +0 -0
  41. mtrinistudio-0.5/app/llama-server.exe +0 -0
  42. mtrinistudio-0.5/app/llama.dll +0 -0
  43. mtrinistudio-0.5/app/main.py +1715 -0
  44. mtrinistudio-0.5/app/main_window.py +151 -0
  45. mtrinistudio-0.5/app/mcp_manager.py +102 -0
  46. mtrinistudio-0.5/app/model.py +336 -0
  47. mtrinistudio-0.5/app/mtmd.dll +0 -0
  48. mtrinistudio-0.5/app/paths.py +19 -0
  49. mtrinistudio-0.5/app/server.py +21 -0
  50. mtrinistudio-0.5/app/static/license-app/icon.png +0 -0
  51. mtrinistudio-0.5/app/static/license-app/index.html +289 -0
  52. mtrinistudio-0.5/app/static/license-app/manifest.json +16 -0
  53. mtrinistudio-0.5/app/templates/index.html +4521 -0
  54. mtrinistudio-0.5/app/templates/login.html +535 -0
  55. mtrinistudio-0.5/app/templates_data.py +16 -0
  56. mtrinistudio-0.5/app/watcher_agent.py +94 -0
  57. mtrinistudio-0.5/app/webview_qt.py +24 -0
  58. mtrinistudio-0.5/config.yaml +17 -0
  59. mtrinistudio-0.5/mcp_servers.json +3 -0
  60. mtrinistudio-0.5/mtrini_cli.py +145 -0
  61. mtrinistudio-0.5/mtrinistudio.egg-info/PKG-INFO +13 -0
  62. mtrinistudio-0.5/mtrinistudio.egg-info/SOURCES.txt +66 -0
  63. mtrinistudio-0.5/mtrinistudio.egg-info/dependency_links.txt +1 -0
  64. mtrinistudio-0.5/mtrinistudio.egg-info/entry_points.txt +2 -0
  65. mtrinistudio-0.5/mtrinistudio.egg-info/requires.txt +5 -0
  66. mtrinistudio-0.5/mtrinistudio.egg-info/top_level.txt +2 -0
  67. mtrinistudio-0.5/setup.cfg +4 -0
  68. mtrinistudio-0.5/setup.py +22 -0
@@ -0,0 +1,17 @@
1
+ MTRINI STUDIO — END USER LICENSE AGREEMENT (EULA)
2
+ Copyright (c) 2026 Oryvia Labs. All rights reserved.
3
+
4
+ IMPORTANT: PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THIS SOFTWARE.
5
+
6
+ 1. LICENSE GRANT
7
+ Oryvia Labs grants you a personal, non-exclusive, non-transferable license to run and use Mtrini Studio in accordance with the terms of this EULA.
8
+
9
+ 2. RESTRICTIONS
10
+ You may not:
11
+ - Decompile, reverse engineer, or disassemble the binary wrapper code.
12
+ - Redistribute premium components (Mtrini Coder Max & Deep) without authorization.
13
+
14
+ 3. DISCLAIMER OF WARRANTY
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL ORYVIA LABS OR ITS CEO (AYHAM HABBAD) BE LIABLE FOR ANY CLAIMS, DAMAGES, OR OTHER LIABILITY.
16
+
17
+ By installing this software, you agree to these terms.
@@ -0,0 +1,9 @@
1
+ include app/llama-server.exe
2
+ include app/*.dll
3
+ recursive-include app/templates *
4
+ recursive-include app/static *
5
+ include config.yaml
6
+ include mcp_servers.json
7
+ include app/icon.ico
8
+ include app/icon.png
9
+ include app/agents_db.json
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: mtrinistudio
3
+ Version: 0.5
4
+ Summary: Mtrini Studio CLI and IDE
5
+ License-File: LICENSE.txt
6
+ Requires-Dist: fastapi
7
+ Requires-Dist: uvicorn
8
+ Requires-Dist: httpx
9
+ Requires-Dist: colorama
10
+ Requires-Dist: PyYAML
11
+ Dynamic: license-file
12
+ Dynamic: requires-dist
13
+ Dynamic: summary
@@ -0,0 +1,76 @@
1
+ # Mtrini 0.2 — Local API & Web Chat (by Mythic Labs)
2
+
3
+ Mtrini 0.2 is a local, secure, and unlimited programming assistant designed by **Mythic Labs**. It runs an open-source coding model (`Qwen2.5-Coder-1.5B`) completely locally on your machine, exposing an OpenAI-compatible endpoint with API Key authentication. This allows you to use it in other coding platforms like **Cursor**, VS Code extensions (like **Continue**), or python scripts.
4
+
5
+ ---
6
+
7
+ ## 1. Quick Setup & Run
8
+
9
+ ### Step 1: Install Dependencies
10
+ Open a terminal in the project directory (`C:\Users\NB\.gemini\antigravity\scratch\mtrini-coder`) and install the requirements:
11
+ ```bash
12
+ pip install -r requirements.txt
13
+ ```
14
+ *(Note: If you have a CUDA-enabled NVIDIA GPU, you may want to install `llama-cpp-python` with CUDA acceleration for faster inference. See [llama-cpp-python installation guides](https://github.com/abetlen/llama-cpp-python#installation-with-openblas--cublas-clblast--metal) if needed).*
15
+
16
+ ### Step 2: Download the Model
17
+ Download the free and open-source Qwen2.5-Coder 1.5B GGUF weights directly from Hugging Face:
18
+ ```bash
19
+ python download_model.py
20
+ ```
21
+ This script will download and verify the `qwen2.5-coder-1.5b-instruct-q4_k_m.gguf` file (~1.12 GB) and place it under `./models/`.
22
+
23
+ ### Step 3: Run the Server
24
+ Start the FastAPI server using Uvicorn:
25
+ ```bash
26
+ python -m uvicorn app.main:app --host 127.0.0.1 --port 8000
27
+ ```
28
+ Your server will start running locally at:
29
+ * **Web Chat UI**: `http://localhost:8000/`
30
+ * **API completions Endpoint**: `http://localhost:8000/v1`
31
+
32
+ ---
33
+
34
+ ## 2. API Key Authentication
35
+
36
+ Mtrini 0.2 utilizes Bearer Token authentication to emulate a real commercial cloud API. The default API key is:
37
+ ```text
38
+ sk-mtrini-mythic-labs-55555
39
+ ```
40
+ You can customize this key (along with CPU threads or context window sizes) by editing [config.yaml](file:///C:/Users/NB/.gemini/antigravity/scratch/mtrini-coder/config.yaml).
41
+
42
+ ---
43
+
44
+ ## 3. Cursor IDE Integration
45
+
46
+ To use Mtrini 0.2 as your coding model directly inside **Cursor**:
47
+
48
+ 1. Open **Cursor Settings** (gear icon in the top right corner of the window).
49
+ 2. Go to **Models**.
50
+ 3. Scroll to the **OpenAI** section or click **+ Add model** under list of models.
51
+ 4. Enter model name exactly as: `mtrini-0.2` and enable it.
52
+ 5. Expand **OpenAI API settings**:
53
+ * Click **Override OpenAI Base URL** and enter:
54
+ `http://localhost:8000/v1`
55
+ * Enter the API Key in the key slot:
56
+ `sk-mtrini-mythic-labs-55555`
57
+ 6. Close settings. Now, in the Cursor Sidebar Chat or inline code editor (`Ctrl+K` or `Ctrl+L`), choose the `mtrini-0.2` model to query your local model!
58
+
59
+ ---
60
+
61
+ ## 4. Querying via Curl
62
+
63
+ Verify the local API is responding correctly using this shell command:
64
+
65
+ ```bash
66
+ curl http://localhost:8000/v1/chat/completions \
67
+ -H "Authorization: Bearer sk-mtrini-mythic-labs-55555" \
68
+ -H "Content-Type: application/json" \
69
+ -d '{
70
+ "model": "mtrini-0.2",
71
+ "messages": [
72
+ {"role": "user", "content": "Write a python function to check if a number is even."}
73
+ ],
74
+ "temperature": 0.2
75
+ }'
76
+ ```
@@ -0,0 +1 @@
1
+ # Mtrini Coder - Local AI Coding Assistant
@@ -0,0 +1,74 @@
1
+ import json
2
+ import os
3
+ import uuid
4
+ import time
5
+ import threading
6
+ from typing import Dict, List, Optional, Any
7
+
8
+ AGENT_DEFINITIONS = {}
9
+ DEFAULT_AGENTS = []
10
+
11
+ def load_agents_db():
12
+ global AGENT_DEFINITIONS, DEFAULT_AGENTS
13
+ db_path = os.path.join(os.path.dirname(__file__), "agents_db.json")
14
+ if os.path.exists(db_path):
15
+ with open(db_path, "r", encoding="utf-8") as f:
16
+ try:
17
+ agents_list = json.load(f)
18
+ for agent in agents_list:
19
+ AGENT_DEFINITIONS[agent["id"]] = agent
20
+ DEFAULT_AGENTS.append(agent["id"])
21
+ except Exception as e:
22
+ print("Error loading agents_db.json:", e)
23
+
24
+ load_agents_db()
25
+
26
+ class AgentSession:
27
+ def __init__(self, agent_id: str, system_prompt: str):
28
+ self.agent_id = agent_id
29
+ self.system_prompt = system_prompt
30
+ self.messages: List[Dict[str, str]] = []
31
+ self.created_at = time.time()
32
+
33
+ def add_message(self, role: str, content: str):
34
+ self.messages.append({"role": role, "content": content})
35
+
36
+ def get_messages_with_system(self) -> List[Dict[str, str]]:
37
+ system = {"role": "system", "content": self.system_prompt}
38
+ recent = self.messages[-40:] if len(self.messages) > 40 else self.messages
39
+ return [system] + recent
40
+
41
+ class OrchestrationRun:
42
+ def __init__(self, run_id: str, user_task: str):
43
+ self.run_id = run_id
44
+ self.user_task = user_task
45
+ self.agent_outputs: Dict[str, str] = {}
46
+ self.status = "running"
47
+ self.created_at = time.time()
48
+
49
+ class AgentManager:
50
+ def __init__(self):
51
+ self.sessions: Dict[str, AgentSession] = {}
52
+ self.runs: Dict[str, OrchestrationRun] = {}
53
+ self._lock = threading.Lock()
54
+
55
+ def get_or_create_session(self, agent_id: str) -> Optional[AgentSession]:
56
+ with self._lock:
57
+ if agent_id not in self.sessions:
58
+ agent_def = AGENT_DEFINITIONS.get(agent_id)
59
+ if not agent_def:
60
+ return None
61
+ self.sessions[agent_id] = AgentSession(agent_id, agent_def["system_prompt"])
62
+ return self.sessions[agent_id]
63
+
64
+ def create_run(self, user_task: str) -> OrchestrationRun:
65
+ run_id = uuid.uuid4().hex[:12]
66
+ run = OrchestrationRun(run_id, user_task)
67
+ with self._lock:
68
+ self.runs[run_id] = run
69
+ return run
70
+
71
+ def get_run(self, run_id: str) -> Optional[OrchestrationRun]:
72
+ return self.runs.get(run_id)
73
+
74
+ agent_manager = AgentManager()