Top Related Projects
Open-source desktop app for local LLMs. Text, vision, tool-calling, OpenAI/Anthropic-compatible API. 100% private.
Stable Diffusion web UI
An open platform for training, serving, and evaluating large language models. Release repo for Vicuna and Chatbot Arena.
JARVIS, a system to connect LLMs with ML community. Paper: https://arxiv.org/pdf/2303.17580.pdf
High-performance In-browser LLM Inference Engine
Quick Overview
Morphic is an open-source project that provides a simple and flexible way to create and manage morphological analyzers for various languages. It aims to simplify the process of building, testing, and deploying morphological analysis tools, making it easier for linguists and developers to work with language data.
Pros
- Easy to use and configure for different languages
- Supports multiple morphological analysis techniques
- Extensible architecture allowing for custom implementations
- Well-documented with examples and tutorials
Cons
- Limited to morphological analysis, not a full NLP toolkit
- May require some linguistic knowledge to use effectively
- Performance may vary depending on the complexity of the language
- Still in active development, so some features may be unstable
Code Examples
- Creating a basic morphological analyzer:
from morphic import Analyzer
analyzer = Analyzer('english')
result = analyzer.analyze('running')
print(result)
# Output: [{'lemma': 'run', 'pos': 'VERB', 'features': {'Tense': 'Pres', 'Aspect': 'Prog'}}]
- Adding custom rules to the analyzer:
from morphic import Analyzer, Rule
analyzer = Analyzer('english')
custom_rule = Rule(r'(\w+)ing', r'\1', {'pos': 'VERB', 'features': {'Tense': 'Pres', 'Aspect': 'Prog'}})
analyzer.add_rule(custom_rule)
result = analyzer.analyze('jumping')
print(result)
# Output: [{'lemma': 'jump', 'pos': 'VERB', 'features': {'Tense': 'Pres', 'Aspect': 'Prog'}}]
- Using the analyzer with multiple languages:
from morphic import Analyzer
en_analyzer = Analyzer('english')
es_analyzer = Analyzer('spanish')
en_result = en_analyzer.analyze('cats')
es_result = es_analyzer.analyze('gatos')
print(en_result)
# Output: [{'lemma': 'cat', 'pos': 'NOUN', 'features': {'Number': 'Plur'}}]
print(es_result)
# Output: [{'lemma': 'gato', 'pos': 'NOUN', 'features': {'Number': 'Plur', 'Gender': 'Masc'}}]
Getting Started
To get started with Morphic, follow these steps:
-
Install Morphic using pip:
pip install morphic -
Import the Analyzer class and create an instance for your desired language:
from morphic import Analyzer analyzer = Analyzer('english') -
Use the analyzer to analyze words:
result = analyzer.analyze('running') print(result) -
Explore the documentation for more advanced features and customization options.
Competitor Comparisons
Open-source desktop app for local LLMs. Text, vision, tool-calling, OpenAI/Anthropic-compatible API. 100% private.
Error generating comparison
Stable Diffusion web UI
Pros of stable-diffusion-webui
- More extensive feature set and customization options
- Larger community and more frequent updates
- Better support for various models and extensions
Cons of stable-diffusion-webui
- Steeper learning curve for beginners
- Higher system requirements for optimal performance
- More complex setup process
Code Comparison
stable-diffusion-webui:
def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iteration=0, position_in_batch=0):
index = position_in_batch + iteration * p.batch_size
clip_skip = getattr(p, 'clip_skip', opts.CLIP_stop_at_last_layers)
token_merging_ratio = getattr(p, 'token_merging_ratio', 0)
token_merging_ratio_hr = getattr(p, 'token_merging_ratio_hr', 0)
morphic:
def generate_image(prompt, negative_prompt, width, height, steps, cfg_scale, sampler, seed):
generator = torch.Generator(device=device).manual_seed(seed)
image = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
width=width,
height=height,
num_inference_steps=steps,
guidance_scale=cfg_scale,
generator=generator,
).images[0]
An open platform for training, serving, and evaluating large language models. Release repo for Vicuna and Chatbot Arena.
Pros of FastChat
- More comprehensive and feature-rich, offering a wider range of functionalities for chatbot development and deployment
- Better documentation and community support, making it easier for developers to get started and troubleshoot issues
- Supports multiple LLM models, providing flexibility in choosing the most suitable model for specific use cases
Cons of FastChat
- Higher complexity and steeper learning curve, which may be overwhelming for beginners or small-scale projects
- Requires more computational resources due to its extensive features and support for multiple models
- Less focused on specific use cases, potentially leading to unnecessary overhead for simpler chatbot applications
Code Comparison
Morphic (Python):
from morphic import Morphic
morphic = Morphic()
response = morphic.generate("Tell me a joke")
print(response)
FastChat (Python):
from fastchat.model import load_model, get_conversation_template
from fastchat.serve.inference import generate_stream
model, tokenizer = load_model("vicuna-7b")
conv = get_conversation_template("vicuna")
conv.append_message(conv.roles[0], "Tell me a joke")
gen = generate_stream(model, tokenizer, conv, max_new_tokens=100)
for response in gen:
print(response, end="", flush=True)
Pros of TaskMatrix
- More comprehensive task management system with a focus on AI-driven task decomposition and execution
- Integrates multiple AI models and tools for diverse task handling
- Supports complex, multi-step tasks with dynamic planning and adaptation
Cons of TaskMatrix
- More complex setup and configuration required
- Potentially higher computational resources needed due to multiple AI models
- Less focus on morphological analysis compared to Morphic
Code Comparison
TaskMatrix:
def decompose_task(task_description):
subtasks = llm.generate_subtasks(task_description)
return [SubTask(desc) for desc in subtasks]
def execute_task(task):
plan = generate_execution_plan(task)
for step in plan:
tool = select_appropriate_tool(step)
result = tool.execute(step)
Morphic:
def analyze_morphology(word):
morphemes = segment_word(word)
return [Morpheme(m) for m in morphemes]
def generate_related_forms(root):
forms = apply_morphological_rules(root)
return [Word(f) for f in forms]
This comparison highlights the different focus areas of the two projects. TaskMatrix emphasizes AI-driven task management and execution, while Morphic concentrates on morphological analysis of language. The code snippets illustrate these distinctions, with TaskMatrix showing task decomposition and execution, and Morphic demonstrating morphological analysis and word form generation.
JARVIS, a system to connect LLMs with ML community. Paper: https://arxiv.org/pdf/2303.17580.pdf
Pros of JARVIS
- More comprehensive and feature-rich, offering a wider range of AI-powered functionalities
- Backed by Microsoft, potentially providing better long-term support and resources
- Includes advanced natural language processing capabilities for more complex interactions
Cons of JARVIS
- Larger and more complex codebase, which may be harder to understand and contribute to
- Potentially higher resource requirements due to its extensive features
- May have a steeper learning curve for new users or developers
Code Comparison
Morphic (Python):
def process_input(self, user_input):
response = self.llm(user_input)
return response
JARVIS (Python):
def process_input(self, user_input):
parsed_input = self.nlp_parser.parse(user_input)
context = self.context_manager.get_context()
response = self.llm.generate(parsed_input, context)
return self.response_formatter.format(response)
The code comparison shows that JARVIS has a more complex input processing pipeline, including parsing, context management, and response formatting, while Morphic has a simpler, more direct approach to handling user input.
High-performance In-browser LLM Inference Engine
Pros of web-llm
- Focuses on running large language models directly in web browsers
- Utilizes WebGPU for accelerated inference on various devices
- Provides a more seamless integration with web applications
Cons of web-llm
- Limited to browser-based environments
- May have performance constraints due to browser limitations
- Requires WebGPU support, which is not universally available
Code Comparison
web-llm:
import * as webllm from "@mlc-ai/web-llm";
const chat = new webllm.ChatModule();
await chat.reload("vicuna-v1-7b");
const output = await chat.generate("Hello, how are you?");
morphic:
from morphic import Morphic
morphic = Morphic()
model = morphic.load_model("vicuna-v1-7b")
output = model.generate("Hello, how are you?")
Both repositories aim to provide easy access to large language models, but they differ in their approach and target environments. web-llm focuses on browser-based deployment, leveraging WebGPU for acceleration, while morphic appears to be a more general-purpose library for model deployment and inference. The code examples demonstrate the different APIs and usage patterns between the two projects.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Features
- AI-powered search with GenerativeUI
- Search modes: Quick and Adaptive
- Model selector with dynamic provider detection (OpenAI, Anthropic, Google, Ollama, Vercel AI Gateway)
- Multiple search providers (Tavily, SearXNG, Brave, Exa)
- Chat history stored in PostgreSQL
- Share search results with unique URLs
- File upload support
- User authentication with Supabase Auth
- Guest mode for anonymous usage
- Docker deployment ready
Installation
Docker (Recommended)
The quickest way to run Morphic locally:
docker pull ghcr.io/miurla/morphic:latest
Then set up with Docker Compose:
- Clone the repository and configure environment:
git clone https://github.com/miurla/morphic.git
cd morphic
cp .env.local.example .env.local
- Edit
.env.localand set at least one AI provider API key:
OPENAI_API_KEY=your_openai_key
See supported providers for other options (Anthropic, Google, Ollama, Vercel AI Gateway).
- Start all services:
docker compose up -d
- Visit http://localhost:3000 and select your model from the model selector.
Docker Compose starts PostgreSQL, Redis, SearXNG, and Morphic automatically. No additional search API key is needed â SearXNG is included.
See the Docker Guide for more options including building from source and file upload configuration.
Local Development
- Clone and install:
git clone https://github.com/miurla/morphic.git
cd morphic
bun install
- Configure environment:
cp .env.local.example .env.local
Edit .env.local and set your API keys:
OPENAI_API_KEY=your_openai_key
TAVILY_API_KEY=your_tavily_key
To enable chat history, authentication, file upload, and other features, see CONFIGURATION.md.
- Start the dev server:
bun dev
Visit http://localhost:3000.
Deploy
Vercel
Contributing
We welcome contributions! Please see our Contributing Guide for details on how to get started, including local development setup.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Top Related Projects
Open-source desktop app for local LLMs. Text, vision, tool-calling, OpenAI/Anthropic-compatible API. 100% private.
Stable Diffusion web UI
An open platform for training, serving, and evaluating large language models. Release repo for Vicuna and Chatbot Arena.
JARVIS, a system to connect LLMs with ML community. Paper: https://arxiv.org/pdf/2303.17580.pdf
High-performance In-browser LLM Inference Engine
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot